Why use SambaFree software and is a way of getting windows like shares on a UNIX machine. Useful for using on the internet network card of the CCP14 Linux server.
|
Where to get Samba
|
Compiling and Installing Samba on Linux
|
Configuring Samba on the internal networkConfig files are in /usr/local/samba/lib The trick is to only have samba working on the internal network card, not the external one. This is done using the bind interfaces only and interfaces directives. Don't forget to add the encrypt passwords = yes or windows won't be able to log in and give cryptic responses. Samba can be quite neurotic so you may have to stick with it. Much of the pain is due to how Windows PCs will want to talk with it and using or not using password encription.
Config FileNote: The last stuff in global is telling the Samba-Server toi be subordinate to Windows servers.
[global] workgroup = IMG server string = CCP14 BBK Interal Data Server hosts allow = 193.61. hosts deny = ALL bind interfaces only = True interfaces = eth0 193.61.35.93 encrypt passwords = yes domain logons = yes username map = /usr/local/samba/lib/users.map smb passwd file = /etc/smbpasswd local master = no domain master = no preferred master = no os level = 0 [tmp] comment = Tmp Iso Image Area path = /tmp/isos browseable = yes public = yes guest ok = yes read only = yes [dataarea] comment = Blah for Simon Jacques path = /web_disc/jacques/dldata browseable = yes public = yes read only = yes valid users = blahuser invalid users = root bin daemon nobody named sys tty disk mem kmem users [homes] comment = Home Directories browseable = no read only = no valid users = jacques ccp14 invalid users = root bin daemon nobody named sys tty disk mem kmem
Adding users into SambaBefore doing this, do: vi /etc/smbpasswd so as to create an empty Samba password file otherwise smbpasswd may not be happy. As root, use : /usr/local/samba/bin/smbpasswd with the -a option e.g., /usr/local/samba/bin/smbpasswd -a user1
Testing SambaSee if things are working from the UNIX point of view: /usr/local/samba/bin/smbclient -L mill.cryst.bbk.ac.uk From a Windows DOS prompt: net use g: \\mill\tmp smbclient copying from a user account from another UNIX machine: smbclient \\\\computername\\username -Uusername |
Killing and Restarting SambaConfig files are in /usr/local/samba/lib
killall -9 smbd killall -9 nmbd /usr/local/samba/bin/smbd -D -s /usr/local/samba/lib/smb.conf /usr/local/samba/bin/nmbd -D -s /usr/local/samba/lib/smb.conf or
killall -9 smbd killall -9 nmbd /usr/local/samba/bin/smbd -D /usr/local/samba/bin/nmbd -D Or create a /usr/local/bin/restartsamba script (don't forget to chmod +x /usr/local/bin/restartsamba)
#! /bin/sh # # Kill and restart Samba # echo -n "Shutting down Samba: " killall -9 smbd killall -9 nmbd echo -n "Restarting Samba " /usr/local/samba/bin/smbd -D /usr/local/samba/bin/nmbd -D echo " done" |