- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Need specifics on how to use "useradd -p" to add u...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-06-2005 03:03 AM
тАО05-06-2005 03:03 AM
This option uses the "crypt" function, yet the man page on useradd and crypt doesn't give specific details on how to use it.
Can anyone give me an example useradd line including how to use the -p command?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-06-2005 03:46 AM
тАО05-06-2005 03:46 AM
Re: Need specifics on how to use "useradd -p" to add user and set pword
user1 teryy@1
user2 onegoat1
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-06-2005 04:47 AM
тАО05-06-2005 04:47 AM
Re: Need specifics on how to use "useradd -p" to add user and set pword
But, can you please give me a bit more detail on how to use it? The man page is not clear.
If I want to create a script to assign a user login "test" with a password of "pword", login of "test2" password "pword2", (for hundreds of accounts) what should the script have in it?
Do I use just a bunch of lines like this?
chpasswd test:pword
chpasswd test2:pword2
, and then run the script from a prompt?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-06-2005 11:41 AM
тАО05-06-2005 11:41 AM
Solutionecho username:password | chpasswd
You can do them individually (like above), or you can put them all in a file, and then:
chpasswd < file
do change them en-masse.
There used to be a small utility to generate an encrypted password to the console included, but I couldn't find it on my system, so this is probably the easiest way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-06-2005 10:58 PM
тАО05-06-2005 10:58 PM
Re: Need specifics on how to use "useradd -p" to add user and set pword
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-06-2005 11:37 PM
тАО05-06-2005 11:37 PM
Re: Need specifics on how to use "useradd -p" to add user and set pword
another method to call it from script is to use passwd utility's --stdin functionality
echo password | /usr/bin/passwd username --stdin
it will set the 'password' as password for user 'username'
remember only root can do this.
Hope this helps,
Gopi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-09-2005 05:55 AM
тАО05-09-2005 05:55 AM