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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

useradd command 2

Status
Not open for further replies.

tech84

Technical User
May 18, 2000
126
US
Hi,

I'm learning the useradd command, and I can't figure out how to create a new user and not have their account locked. The only way I can figure is to go into admintool after creating the account with useradd, and setting the password parameters there. Isn't there a better way?

Thanks!

Mike
[morning]
 
# Syntax for adding a Solaris Unix user #

useradd -m -d /export/home/<username> <username>
 
Yes, but now the account is created and locked. Is there no way to create the account w/o having it locked by default?

Thanks Mike
[morning]
 
type 'passwd <username>' and set the password which unlocks it.
 
man userad:

useradd adds a new user entry to the /etc/passwd and /etc/shadow files. It also creates supplementary group memberships for the user (-G option) and creates the home directory (-m option) for the user if requested. The new login remains locked until the passw(1) command is exe-cuted.

I dont think there is a way around it. Why would you want the account unlocked.
[2thumbsup]
 
Ahhh... the passwd command. Thanks.

Well, I would want the user to be able to log in after I create his/her account w/o any additional administration. I'm used to setting up new users with a one-time password. I supposed you can do the same in Solaris, right, but it just takes an extra step?

(Don't get me wrong... in a short period of time, I'm starting to see the advantages of Unix over Windows pretty clearly!)

Thanks to both of you!

Mike
[morning]
 
at the useradd command you can set the password string; however this is the encoded string, and the only way to get this is to set it and then extract it from /etc/shadow

if you don't want to set a password and for them to set it then you can edit /etc/shadow and remove the second field on a line (might say 'NP' or '*' or even '*LK*' if accounts is locked.

even so, it's not too hard to type 'passwd <user>' afterwards :)
 
Thanks for the info!

I see your point, though... it's much quicker and easier to use the passwd command.

Mike
[morning]
 
There are a lot of steps that we take when we add users on our system. I got around this by creating a script that reads input $USERNAME, does a adduser, creates the home directory, chmod and chown it, and does a passwd.

All I type is:

./adduser
&username
&password
&password

 
Boy, you guys are gurus! I would give anything to hang out with you at work for a week or two and pick up all of your tips and tricks. I'm learning all I can from getting certified and working with a couple of SPARCStations at home, but I'd kill to get some system admin hands-on. Any of you work in Dallas? ;-)

I'll just continue to use this forum. I've received a lot of great tips from the folks on this site!

Thanks again! Mike
[morning]
 
The other way,you can install webmin into your sun server.
After that you can add user from webmin.And you can set any feature.You can download from Webmin is more user friendly web interface for managing your sun server.If I didn't misunderstand your needs.
 
once you get used to the command line tho, it is hard to hand over control to a GUI :) also GUI's don't work over web links to multiple sites, without some serious VPN configuration.
 
Okay, you guys are WAY over my head now! Ha! I don't even have a server set up yet. I don't even know how to set up a server in unix. I'll get there though.

Thanks for the tips, tho! Webmin does look pretty cool. I'm a corn-fed GUI user, being a Windows man and all. But luckily, I grew up with DOS, so I'm starting to get back in the swing of the command line world.

Mike
[morning]
 
server == workstation with a few extra services.

if you do a full install from the install media you should have almost all the services you ever need for running as a server.

if you did an end-user install then you should have most of a pure workstation. however it still sets up printer spooling and printer sharing, and you have telnet, ftp, rlogin, shares ...

the difference is much less than you could probably imagine :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top