Contents
$ wget -c http://gr.samba.org/samba/ftp/stable/samba-3.2.6.tar.gz $ tar zxvf samba-3.2.6.tar.gz $ cd samba-3.2.6/source $ ./configure $ make $ sudo make installl
$ ./configure --with-fhs --with-ldap --with-automount --with-smbmount --with-libsmbclient --with-winbind
# touch /usr/local/samba/etc/samba/smb.conf # mv /etc/samba/smb.conf /etc/samba/smb.conf.old # ln -s /usr/local/samba/etc/samba/smb.conf /etc/samba/smb.conf # /usr/local/samba/sbin/smbd -D
# /usr/local/samba/sbin/smbd -F -S
[global] workgroup = MYWORKGROUP server string = My Samba Server security = SHARE log file = /var/log/samba.log [myshare] comment = My Share path = /opt/myshare force user = nobody force group = nogroup read only = No guest ok = Yes volume = myshare
$ cat /etc/init.d/smbd #!/bin/sh # Start / Stop Samba SMB/CIFS Daemon # ebal 12.01.2008 server="Samba SMB/CIFS Daemon" pidfile="/usr/local/samba/var/run/smbd.pid" daemon="/usr/local/samba/sbin/smbd -D" if [ -f $pidfile ]; then status=1 else status=0 fi case "$1" in 'start') if [ 1 -eq $status ]; then $0 status else echo "Starting "$server "..." $daemon sleep 1 $0 status fi ;; 'stop') if [ 1 -eq $status ]; then echo "Stoping "$server "..." kill -15 `cat $pidfile` sleep 1 rm -f $pidfile $0 status else $0 status fi ;; 'status') if [ 1 -eq $status ]; then echo $server "is runnning with pid: `cat $pidfile`" else echo $server "is NOT running"; fi echo ;; 'restart') $0 stop $0 start ;; *) echo -n "Usage: $0 {start|stop|restart|status)"; echo ""; exit 1 esac
$ smbstatus Global parameter guest account found in service section! Samba version 3.0.28 PID Username Group Machine ------------------------------------------------------------------- Service pid machine Connected at ------------------------------------------------------- No locked files
$ smbclient -U% -L localhost Domain=[MYWORKGROUP] OS=[Unix] Server=[Samba 3.0.28] Sharename Type Comment --------- ---- ------- myshare Disk IPC$ IPC IPC Service (My Samba Server) Domain=[MYWORKGROUP] OS=[Unix] Server=[Samba 3.0.28] Server Comment --------- ------- MY.SERVER.GR My Samba Server Workgroup Master --------- ------- MYWORKGROUP
$ testparm samba.sample.config [global] workgroup = MYWORKGROUP server string = My Samba Server interfaces = 10.10.10.1/255.255.255.0 bind interfaces only = Yes security = SHARE log file = /var/log/samba.log hosts allow = 10.10.10. hosts deny = ALL [myshare] comment = My Share path = /opt/myshare force user = nobody force group = nogroup read only = No guest ok = Yes volume = myshare
smbget -u ebal -p'test' smb://192.168.2.2/C$/imortant/data.rar
[global] log file = /usr/local/samba/var/samba.log printcap name = /dev/null smb passwd file = /usr/local/samba/lib/smbpasswd [storage] path = /storage
# smbpasswd -a test New SMB password: Retype new SMB password: Added user test. # cat /opt/samba-3.2.5/lib/smbpasswd test:1001:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:0CB6948805F797BF2A82807973B89537:[U ]:LCT-493EF7DB:
# mkdir -pv /media/storage # smbmount //192.168.1.1/storage /media/storage/ -o user=test,pass='test'
[global] server string = Samba Server log file = /var/log/samba/%m.log max log size = 50 dns proxy = No idmap config * : backend = tdb # Global security map to guest = Bad User security = user public = Yes [data] path = /mnt/data/ writable = Yes read only = No
# ebal, Sat, 15 Feb 2014 21:24:45 +0200 [global] workgroup = MYWORKGROUP server string = Samba Server max log size = 50 log file = /var/log/samba/%m.log printcap name = /dev/null idmap config * : backend = tdb dns_proxy = no security = user map to guest = Bad User guest account = myuser [myshare] comment = myshare path = /backup/myshare force user = myuser force group = mygroup read only = No guest ok = Yes public = Yes only guest = Yes writable = Yes
[link2] http://gr.samba.org/samba/docs/man/Samba-HOWTO-Collection/
[link3] http://gr.samba.org/samba/docs/using_samba/toc.html