lost and found ( for me ? )

Linux Mint 12 : Samba basic configuration

Here’s an explanation of how to install Samba and basic set up on Linux Mint 12.

[ install Samba ]

# uname -ri
3.0.0-14-generic x86_64

# tail -1 /etc/lsb-release

install Samba via apt-get
# apt-get install samba –y

# smbd --version
Version 3.5.11

# nmbd --version
Version 3.5.11

[ Basic configuration ]

create a test user for Samba
# adduser samba-test1

create the samba account for user samba-test1.
# smbpasswd -a samba-test1
New SMB password:
Retype new SMB password:
Added user samba-test1.

create the directory for Samba and change the ownership of its directory.
# mkdir /home/samba-test1/test
# chown samba-test1.samba-test1 /home/samba-test1/test

edit /etc/samba/smb.conf
add the following lines to share user’s home directory.
comment = %u's Home Directories
browseable = yes
directory = /home/%u/test
create mask = 0644
directory mask = 0755
valid users = %S
writable = yes

start smbd and nmbd
# /etc/init.d/smbd start
# /etc/init.d/nmbd start

# testparm /etc/samba/smb.conf
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Processing section "[print$]"
Loaded services file OK.
Press enter to see a dump of your service definitions

       dos charset = CP932
       server string = %h server (Samba, LinuxMint)
       map to guest = Bad User
       obey pam restrictions = Yes
       pam password change = Yes
       passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
       unix password sync = Yes
       syslog = 0
       log file = /var/log/samba/log.%m
       max log size = 1000
       dns proxy = No
       usershare allow guests = Yes
       panic action = /usr/share/samba/panic-action %d

       comment = %u's Home Directories
       path = /home/%u/test
       valid users = %S
       read only = No
       create mask = 0644

       comment = All Printers
       path = /var/spool/samba
       create mask = 0700
       printable = Yes
       browseable = No

       comment = Printer Drivers
       path = /var/lib/samba/printers

access to the Samba via Windows

on Windows7
\\Samba’s IP\samba-test1

hello.txt file was created under /home/samba-test1/test directory
# cat /home/samba-test1/test/hello.txt

# ls -l /home/samba-test1/test/hello.txt
-rw-r--r-- 1 samba-test1 samba-test1 7 date /home/samba-test1/test/hello.txt

check the Samba status
# smbstatus

Samba version 3.5.11
PID     Username      Group         Machine
9387      samba-test1   samba-test1   test         (client IP)

Service      pid     machine       Connected at
samba-test1   9387   test         date

Locked files:
Pid          Uid        DenyMode   Access      R/W        Oplock           SharePath   Name   Time
9387         1004       DENY_NONE  0x100081    RDONLY     NONE             /home/samba-test1/test   .  date

1 comment:

Note: Only a member of this blog may post a comment.