Monday, December 13, 2010

samba conf

After a long gap I got a requirement to configure samba on Linux Machine.
Here is the generic and very easy to use configuration file.

[root@localhost ~]# cat /etc/samba/smb.conf
# smb.conf is the main Samba configuration file.
workgroup = TUX-NET
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
map to guest = Bad User
include = /etc/samba/dhcp.conf
logon path = \\%L\profiles\.msprofile
logon home = \\%L\%U\.9xprofile
logon drive = P:
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes
comment = Network Profiles Service
path = %H
read only = No
store dos attributes = Yes
create mask = 0600
directory mask = 0700
comment = All users
path = /home
read only = No
inherit acls = Yes
veto files = /aquota.user/groups/shares/
comment = All groups
path = /home/groups
read only = No
inherit acls = Yes
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @ntadmin root
force group = ntadmin
create mask = 0664
directory mask = 0775
[root@localhost ~]#
create a user
[root@localhost ~]# useradd naresh
set the password for the user
[root@localhost ~]# /usr/bin/smbpasswd -a naresh
New SMB password:
Retype new SMB password:
Added user naresh.

[root@localhost ~]#
Now the user is added to samba and password is set.
Start the samba service.

[root@localhost ~]# /etc/init.d/smb start
Starting SMB services:
Starting NMB services:
make sure that Samba service is running as daemon process.
[root@localhost ~]# ps ax | grep mbd
2289 ? Ss 0:05 nmbd -D
4505 ? Ss 0:00 smbd -D

Now you can access Linux file system from windows by doing

Enter the user name and password and access your Linux file system as windows file system. Every user can access this own home directory. Of,course root can access all the file system.

you may map remote directory in to local drive. follow the steps

Mycomputer-> Tools->MapNetworkDrive->
Driver: Z:

If you find any issues let me know.

No comments: