Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto setup Samba passwords by command line?

Status
Not open for further replies.

SunBurnt5

Technical User
Jun 14, 2006
7
US
1) Do I absolutely have to have Machine accounts?
2) Do I absolutely have to have Linux user accounts?

I'd like to keep it as simple as possable,
just Samba's "smbmount" username & password.

I need to setup Samba's password like this:

smbpasswd -a ( UserName ) ( PassWord )

or this:
smbpasswd -a ( UserName ) -w ( PassWord )

It doesn't seem to add to or change the .smbpassword file.

I'm setting Samba up so users can do their own "new login".
I have a GTK login dialog, & want Bash to enter the values
via the command line.
Entry boxes for UserName, PassWord #1, & PassWord #2.

If I have to I could write directly to .smbpassword but I'd
rather use Samba's smbpasswd utility.
 
Q1 Answer: No, they are not neccessary to use Samba.
Q2 Answer: Yes. Samba needs to map permissions to the file system based on the user's credentials. The Unix account can exist without no one ever loggin into it. Use [red]-s /sbin/nologin[/red] when creating the Unix account to dis-allow the user from logging in.

The [blue]-w[/blue] option only works when Samba is compiled with LDAP support.

Have Fun! [afro2]
 
Thanks IRudebwoy; That helps alot because of the following:

The Linux distro. does auto. Login, everyone's ROOT, so file permissions are kinda moot.
I'm modifying it as a PXE LanBoot client that smbmounts user's HOME & /usr.
The Lan clients do a smbmount login to the [homes] share, if successful then mount /usr.

So Samba needs the file: /etc/passwd to list the Lan clients info.
So I need a command to write user's info to the /etc/passwd file.
And then I'll have to write more info to the smbpassword file.

I've got somemore reading ahead of me...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top