LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Samba - Adding users (https://www.linuxquestions.org/questions/linux-networking-3/samba-adding-users-209982/)

TheRealDeal 07-26-2004 06:52 PM

Samba - Adding users
 
Hello.

I have looked everywhere and read every man page to no avail. All I want to know how to do is to add a samba username, which is different to the local username.

For example.

Local user = john_doe

I want user john_doe to be able to log in using the smb username johnd for example.

I used to do this with the /usr/bin/smbadduser command which was in RH9. However this command isn't in RHEL3, the Fedora's, or Gentoo (as far as I can see).

Reading through all of the man pages the only way I can see that you can do this is with the smbpasswd -a john_doe command.

Is this correct? Or am I missing something simple?

All I want to be able to do is have different local usernames to the smb usernames?

If anyway can help me out here that would be great!!! :)

PS. I don't want to use redhat-config-samba.

Thanks
Craig :)

Simon_6162 07-26-2004 07:32 PM

personally on redhat systems i use

redhat-config-samba
or for none redhat systems download samba-SWAT

bot are nice graphical way to control samba

the hard way (fast way ) is just type in the use map into
/etc/samba/smbusers

in the form :
Unix_name = SMB_name1 SMB_name2
then i think you run smbpasswd SMB_name1

MS3FGX 07-26-2004 10:30 PM

You were right:

Code:

smbpasswd -a john_doe
Is the correct command to add a Samba user.

However, to have people login with a different name than that one (like you said you would want johnd to mean john_doe) you need to use a username map.

TheRealDeal 07-26-2004 11:02 PM

Hi.

Thanks for that. Do you mean like adding the mapping manually in the smbusers file?

Thanks
Craig

MS3FGX 07-26-2004 11:38 PM

To create a usermap, you would do this.

1. Add the line "username map= \etc\samba\usermap" to the global section of your smb.conf. The file name and path don't actually matter, it can be whatever you chose, so do what works for you.

2. Create the file that the "username map" parameter is pointing to

3. In that file, add the username maps in the following format:
Code:

LocalUserName = SMBUserName
So yours would look like this:
Code:

john_doe = johnd
You can do it with mutliple names as well, like:
Code:

john_doe = johnd djohn
You could even use a wildcard so any names containing a certain string can equal a local user name:
Code:

john_doe = *john*

TheRealDeal 07-26-2004 11:46 PM

Great thanks for that!!! I'll give it a go.

Thanks again!

Regards,
Craig


All times are GMT -5. The time now is 06:54 AM.