Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
09-07-2011, 04:47 AM
|
#1
|
LQ Newbie
Registered: Nov 2009
Posts: 27
Rep:
|
creating multiple user in multiple linux boxes from single remote host
Hi,
I have 30 remote hosts. I use to use ssh to login remotely to those linux servers. Now i need to create an extra username and password to all of those 30 hosts. Manually it takes time to login each host and creating username and password.
I need to ask is there any tool so that i can create username and password in those required 30 hosts at a time from my remote pc ? Or is there any fruitful solution available ?
|
|
|
09-07-2011, 08:47 AM
|
#2
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,146
|
Quote:
Originally Posted by niaz_ph
Hi,
I have 30 remote hosts. I use to use ssh to login remotely to those linux servers. Now i need to create an extra username and password to all of those 30 hosts. Manually it takes time to login each host and creating username and password.
I need to ask is there any tool so that i can create username and password in those required 30 hosts at a time from my remote pc ? Or is there any fruitful solution available ?
|
If you already have one user set up with the password you want, look in the /etc/shadow file for that user, and *ALL* the text between the first two colons ":" is the encrypted password.
From the command line, you can do:
Code:
ssh <user>@<remote system> "sudo useradd -c comment -m -d /home/username -p <encrypted password from above>"
So, a shell-script could loop through all 30 quickly, and shove a user in. You could also just up-arrow the command, change the remote machine address, and press ENTER too. 30 systems would take you less time than writing a script, or posting in a forum.
|
|
1 members found this post helpful.
|
09-10-2011, 12:34 PM
|
#3
|
LQ Newbie
Registered: Nov 2009
Posts: 27
Original Poster
Rep:
|
Quote:
Originally Posted by TB0ne
If you already have one user set up with the password you want, look in the /etc/shadow file for that user, and *ALL* the text between the first two colons ":" is the encrypted password.
From the command line, you can do:
Code:
ssh <user>@<remote system> "sudo useradd -c comment -m -d /home/username -p <encrypted password from above>"
So, a shell-script could loop through all 30 quickly, and shove a user in. You could also just up-arrow the command, change the remote machine address, and press ENTER too. 30 systems would take you less time than writing a script, or posting in a forum.
|
Hi,
Thanks for the info....Actually i want to create username and password to 30 remote hosts. each host contains different ip. i want to create for example user: linux and password: 12 to those 30 hosts at a time ... Is it possible without creating the username and password manually ?
|
|
|
09-12-2011, 03:48 PM
|
#4
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,146
|
Quote:
Originally Posted by niaz_ph
Hi,
Thanks for the info....Actually i want to create username and password to 30 remote hosts. each host contains different ip. i want to create for example user: linux and password: 12 to those 30 hosts at a time ... Is it possible without creating the username and password manually ?
|
Yes...I told you how above, and even gave you the command to do it.
Again, put the command into a script to loop through all 30 addresses/names, and execute it. That's it. I'm still confused, though, since you could have easily created all the users manually in far less time than it took to post the question and follow-up here.
|
|
|
All times are GMT -5. The time now is 04:51 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|