Quote:
“ |
For those of you who don’t know what samba is it is a free software implementation of Microsoft's networking system released under the GNU General Public License. As of version 3, Samba not only provides file and print services for various Microsoft Windows clients but can also integrate with a Windows Server domain, either as a Primary Domain Controller (PDC) or as a Domain Member. It can also be part of an Active Directory domain.
Samba runs on most Unix and Unix-like systems, such as GNU/Linux, Solaris, and the BSD variants.
|
” |
Im going to show you a very simple demonstration on what the magic of samba can do. This is just a very tiny example and it is not by all means best practise methods. Your server will be insecure so this is not suitable for enterprise enviroments - like i said its to show you what samba can do.
Im assuming for you to be trying this you must either know a little linux or learning as you going along - i will be using debian as the distro.
First of all make sure you have the samba package installed if not:
Code:
apt-get install samba
After the packages have been obtained a short set up routine will automatically start. Answer the prompts as follows:
- Enter your Workgroup or Domain name
- Answer Yes to encrypted passwords
- Answer No to "get WINS settings from DHCP" - assuming you are running a DHCP server (i.e. from a router like me)
- Choose to run Samba as daemons
- Answer Yes to create the Samba passwords file
The Samba configuration files were installed in the following directory:
Now using your favourite text editor edit the smb.conf file for example:
Code:
vi /etc/samba/smb.conf
And make the following changes in
BOLD BLUE:
Code:
[global]
workgroup = YOURWORKGROUPNAME
server string = %h server (Samba %v)
; wins support = no
; wins server = w.x.y.z
dns proxy = no
; name resolve order = lmhosts host wins bcast
log file = /var/log/samba/log.%m
max log size = 1000
; syslog only = no
syslog = 0
panic action = /usr/share/samba/panic-action %d
security = share
encrypt passwords = true
passdb backend = tdbsam guest
obey pam restrictions = yes
; guest account = nobody
invalid users = root
; unix password sync = no
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n .
; pam password change = no
load printers = yes
printing = bsd
printcap name = /etc/printcap
; printing = cups
; printcap name = cups
; printer admin = @ntadmin
preserve case = yes
short preserve case = yes
; include = /home/samba/etc/smb.conf.%m
socket options = TCP_NODELAY
; message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &
; domain master = auto
; idmap uid = 10000-20000
; idmap gid = 10000-20000
; template shell = /bin/bash
[files]
comment = Shared Files
path = /home/ftp
writable = yes
guest ok = yes
[homes]
comment = Home Directories
browseable = no
writable = no
create mask = 0700
directory mask = 0700
;[netlogon]
; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
; writable = no
; share modes = no
[printers]
comment = All Printers
browseable = yes
path = /tmp
printable = yes
public = yes
writable = yes
create mode = 0777
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
; write list = root, @ntadmin
;[cdrom]
; comment = Samba server's CD-ROM
; writable = no
; locking = no
; path = /cdrom
; public = yes
; preexec = /bin/mount /cdrom
; postexec = /bin/umount /cdrom
Now i suggest you restart the operating system.
Next you should add a new user using the
adduser command and give the details you are asked.
You will now have to assign this users samba password so:
Code:
smbpasswd -a username
and provide a password.
Now login into the debian system using the user you just create using their normal credentials. Create a folder in that users /home directory and assign the user
Now on a Windows machine make sure that Windows client is on the same IP range and that it has the same workgroup name as the debian machine. Open Network Places and there should be a machine with the name of the debian machine. Double click and enter your username and SAMBA password you created. And you will see you can now read,write and store all your files on the linux server.