- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: script to create new user and set a password
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
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
тАО03-04-2012 08:18 PM - edited тАО03-04-2012 09:22 PM
тАО03-04-2012 08:18 PM - edited тАО03-04-2012 09:22 PM
script to create new user and set a password
Hi,
i have more than 150 servers, please i need a script to create new user and set a password, where i can't login to each server to set password. i have a tools to push and run this script on all servers. but only i need this script.
And all system on trusted mode and OS is HP-UX 11.31.
i don't need interactive script because i want to push it to all user to create specific user with specific password
your support please.
Thanks
- Tags:
- Password
- usermod.sam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-04-2012 11:51 PM
тАО03-04-2012 11:51 PM
Re: script to create new user and set a password
Hello,
Maybe this can hep you:
http://www.circlingcycle.com.au/Unix-sources/add-batch-Unix-accounts.pl.txt
You will possibly need to modify it a bit to match your exact needs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-05-2012 01:23 AM
тАО03-05-2012 01:23 AM
Re: script to create new user and set a password
Hi,
thanks for your support, but i need a simple scripts if you have, when i try to modify this script will take more time.
i am not a good to write scripts.
thanks agin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2012 02:45 AM
тАО03-07-2012 02:45 AM
Re: script to create new user and set a password
please any help, your support.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2012 07:14 AM
тАО03-07-2012 07:14 AM
Re: script to create new user and set a password
Actually, you don't need a script. You just need to run one command in each host to create the user. But first you'll need to generate an encrypted (actually hashed) password for the new user.
An encrypted password can be created using the "openssl passwd" command:
$ openssl passwd -crypt Password: <type the password here> Verifying - Password: <type the password again here> <encrypted_password_here>
If you run this command again and type the same password, you will get a different encrypted password string each time. This is normal.
Once you have the password in encrypted form, you can build the command for creating the user account.
The command to create an account "jluser" for John L. User would be:
/usr/sbin/useradd -c 'John L. User' -m -p '<encrypted_password_here>' jluser
Run "man useradd" and read to find out what the options mean.
NOTE: since the encrypted password may contain characters that have a special meaning to the shell, you should use single quotes around it, exactly as in the example above. The single quotes are the "strongest" quotes available in any common Unix shell.
NOTE 2: the encrypted password generated by "openssl passwd -crypt" is a bit weak: with modern computers, it is too easy to check a large dictionary of words and find the original password that matches a given encrypted password. But it is the only form of encrypted password that is acceptable for all HP-UX 11.31 password configurations: traditional Unix mode, the deprecated Trusted System Mode, and the Shadow Password mode.
NOTE 3: read the documentation of your command-pushing tool and see if it treats any characters specially. If it does, and your encrypted password string contains one of the special characters, you may need to do something to tell the command-pushing tool to not apply the special meaning of the character in the encrypted password. If your command-pushing tool is any good, it should be able to do this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2012 11:32 PM
тАО03-09-2012 11:32 PM
Re: script to create new user and set a password
thanks for your support, i run the below commands on each servers.
$ openssl passwd -crypt
Password: <type the password here>
Verifying - Password: <type the password again here>
<encrypted_password_here>
/usr/sbin/useradd -m -p '<encrypted_password_here>' newuser
/user/lbin/modprpw -v newuser ====> to reset aging password to zero
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-28-2012 09:37 AM
тАО03-28-2012 09:37 AM
Re: script to create new user and set a password
I think if you put that in a loop to run on all the servers . you will need to give password for each server two times .
If you want to avoid entering the passwd everytime instead specify command line . YOu can use expect ..
If need any help related to expect let me know .
Sachin Rajput
=============
Sachin Rajput
================
- Tags:
- expect