Tuesday, February 21, 2012

Add samba user

At this point you should be able to see the samba server from any windows system in the same workgroup but you won't be able to access the share; not until you add the user(s).

Samba authenticates its users through its local database. Once you have saved the changes to smb.conf , you need to add the users.

Since you enabled the encrypted password option in your smb.conf, you need to add the users with encrypted password.

Add your existing users to samba or create new users and then add them to samba.



[root@server2 samba]# smbpasswd –a agustin
New SMB password: ********
Retype new SMB password:********

Enter the password in 8 character length or more, if you enabled the user name length specification, then it must meet the requirement. Note that agustin is an existing user in the system.

Note. If the command fails it is because the password file does not exist. Retouch the file with the following command and try again.

[root@server2 samba]# touch /etc/samba/smbpasswd

Finally change the smbpasswd security to 644

[root@server2 samba]# chmod 644 smbpasswd

That command will make it read only!