It has been a number of years since I set Samba up on my QNX 4
machine. I didn’t compile anything, so either everything was
included with QNX 4, or some of it was downloaded, probably
from Quics. I don’t really remember how I got to my current
configuration, but it has worked happily for a very long time
without problems.
Of fabulous help was the Using Samba O’Reilly book. This is one
of the most readable and helpful books the the O’Reilly series
and it includes a lot of troubleshooting and configuration stuff.
If you want to use Samba, buy the book !
The following is the config file for smbd which is the Samba daemon.
I have the daemon starting from inetd.conf and it just goes away
after it isn’t needed anymore and starts again later when needed:
netbios-ssn stream tcp nowait root /usr/local/bin/smbd smbd
I use printers physically connected on a QNX 4 machine from Windows
2000 machines. My setup is a little weird, because I use lp from
Solaris to queue print jobs on QNX. lp feeds lpsrvr.
I also mount my QNX home directory and write to it from Windows.
Depending on what machines are up, you may be happier with a Windows
machine being the “Master Browser”. In my case, QNX is always up so
I let it do it.
You need to define the usernames and passwords used on the Windows
machines on QNX, so that it can validate what is received from the
Windows machines when accessing the QNX home directory. Use the
smbpasswd command, which stores the results in
/usr/local/samba/private/smbpasswd
; /etc/smbd.conf
[global]
;debug level = 3
netbios name = alpha (this is the hostname of the QNX 4 machine)
load printers = yes
printing = qnx (use lpsrvr)
security = user
revalidate = no
username map = /etc/smb.map (the file where the microsoft passwords
are stored on QNX)
encrypt passwords = yes (necessary for NT, W2K, XP, probably ME)
workgroup = WORKGROUP (must match the workgroup on Windows)
guest account = nobody
dead time = 15
lock directory = /tmp/spool/smbd
hosts allow = 129.211.85.96/255.255.255.224 192.168.1.
(allow connections from two networks)
interfaces = 129.211.85.101/27 (IP address of the QNX 4 machine
in a small subnet)
log file = /syslog/smbd
browseable = yes
status = yes
dead time = 15
keep alive = 300
; Be Preferred Master Browser For Local Network
local master = yes
preferred master = yes
remote announce = 192.168.1.255/WORKGROUP
[printers]
path = /tmp/spool/smbd
writeable = no
printable = yes
read only = yes
public = yes
guest ok = yes
print command = /bin/cp %s /pr/smb; rm %s (little weird because I have
lpq command = /usr/ucb/lprq -P %p lp feeding lpsrvr)
[homes]
valid users = jeffp (match the login names on QNX
writable=yes and Windows or mega-ugly)
browseable=no
create mask = 0600
directory mask = 0700
To access Windows shares from QNX, you need to:
- start the Samba filesystem
- define the username and password
- mount the shares
This is a piece of a shell script I run as root:
/bin/SMBfsys -d20 &
/bin/sleep 1
/usr/bin/user_smb qnx4 ‘swordfish’ >/dev/null
/usr/bin/user_smb -u jeffp qnx4 ‘swordfish’ >/dev/null
/bin/sleep 1
/bin/mount_smb -s -mu //bravo/sharedir /w/sharedir
/bin/mount_smb -s -mu //bravo/cdrom /w/cdrom
/bin/mount_smb -s -mu //bravo/drived /w/d
The user_smb command identifies the name and password valid on
the Windows machine that will be used when a process accesses
the Windows filesystem. I define the same name and password for
both root and myself as a user, since I flip back and forth
between them. You need to define a login/password for each
different UID that a process will run as to access the shares.
For convenience, I mkdir /w as a mount point and then mount all
the various shares there. You will have one subdirectory for
each Windows share that you mount, even though they may be from
different machines. You can mount things wherever you like.
On the Windows machine, create a new user, “qnx4” in the example
above that will be used to define permissions of the process
running on the QNX machine. This way you can provide only
limited permissions to the shared directories when accessed by
the QNX machine.
You need to define the shares. Click on a folder and look at the
Properties. Select Share this folder. Give it a name. Click on
Permissions and Add the qnx4 user and provide the desired
permissions. I never quite figured out the differences, but you also
have to click on Security and assign the same user permissions here
too. If another Windows machine can access the share and the
permissions are the same for the QNX user as your remote Windows
user, you have them correct.
Make it all work on a local subnet first. You need NetBIOS over
TCP/IP to make things work. If you want to access things from
another subnet, then you might have to make a domain controller
work. By mucking with LMHOSTS, you can make it work if you
directly specify the hostname, since you won’t be able to browse
to the share. Create a link on your desktop and type \alpha
as the target. When you click on the link it will ask for your
password. If you Windows login and password are properly set up
on QNX, then you will have full access, even though you can’t
browse.
Hope this helps !