Sunday, April 20, 2025

How to configure ftp server on QNX 7.1 with PAM user authentication

How to configure ftp server on QNX 7.1 with PAM user authentication

Create empty folder, I am using vm12
C:\> cd \
C:\> mkdir vms
C:\> cd vms
C:\vms> mkdir vm12
C:\vms> cd vm12
Bootstrap the VM, this creates a VirtualBox VM. Note that you have to install VirtualBox on this computer
C:\vms\vm12>C:\qnx710\host\win64\x86_64\usr\bin\bash C:/qnx710/host/common/bin/mkqnximage --noprompt --hostname=vm12 --type=vbox --arch=x86_64 --build
Update system_files.custom
C:\vms\vm12>nvim C:\vms\vm12\local\snippets\system_files.custom
Below contains more than just FTP but lines 5 to 21 are for FTP server
# local/snippets/system_files.custom
# Placeholder for local list of files to add to system partition
lib/libpci.so.2.3=lib/libpci.so.2.3
lib/libpci.so.3.0=lib/libpci.so.3.0
xbin/inetd=usr/sbin/inetd
xbin/telnetd=usr/sbin/telnetd
xbin/ftpd=usr/sbin/ftpd
etc/inetd.conf={
telnet stream tcp nowait root /system/xbin/telnetd in.telnetd
ftp stream tcp nowait root /system/xbin/ftpd in.ftpd -c /system/etc
}
[perms=444] pam/config/ftpd = {
auth requisite pam_qnx.so
account requisite pam_qnx.so
session requisite pam_qnx.so
password requisite pam_qnx.so
}
etc/ftpusers={
root allow
qnxuser allow
}
Update ifs_files.custom to sym link /system/xbin/login to /bin/login
# local/snippets/ifs_files.custom
# Placeholder for local list of files to add to ifs
[+script] .script = {
procmgr_symlink /system/xbin/login /bin/login
}
Update post_start.custom to start super server (inetd)
# local/snippets/post_start.custom
# Commands executed from post_startup.sh. Executed at the end of system startup whether slm is in use
# or not
#
# To allow resource managers to be run properly with and without security policies, command lines
# should be written in one of the following forms:
#
# START(resmgr_t) resmgr DROPROOT(resmgr_uid)
# STARTU(resmgr_t, resmgr_uid) resmgr
# Where resmgr_t is the security type name (arbitrary but usually the name of the resmgr with _t appended),
# and resmgr_uid is the id to use for both uid and gid. DROPROOT is used only in cases where the
# resource manager supports a -U option for switching to non-root.
inetd -D /system/etc/inetd.conf
Rebuild and run the VM, like:
C:\vms\vm12>C:\qnx710\host\win64\x86_64\usr\bin\bash C:/qnx710/host/common/bin/mkqnximage --noprompt --hostname=vm12 --type=vbox --arch=x86_64 --build --force --run

No comments:

Configuring TUN/TAP virtual network interface for use with QEMU on Xubuntu 24.04

Configuring TUN/TAP virtual network interface for use with QEMU on Xubuntu 24.04 I am planning to run qemu-system-ppc to play around QEMU ...