LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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

Reply
 
Search this Thread
Old 09-07-2011, 04:47 AM   #1
niaz_ph
LQ Newbie
 
Registered: Nov 2009
Posts: 27

Rep: Reputation: 0
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 ?
 
Old 09-07-2011, 08:47 AM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,642

Rep: Reputation: 2574Reputation: 2574Reputation: 2574Reputation: 2574Reputation: 2574Reputation: 2574Reputation: 2574Reputation: 2574Reputation: 2574Reputation: 2574Reputation: 2574
Quote:
Originally Posted by niaz_ph View Post
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.
Old 09-10-2011, 12:34 PM   #3
niaz_ph
LQ Newbie
 
Registered: Nov 2009
Posts: 27

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
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 ?
 
Old 09-12-2011, 03:48 PM   #4
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,642

Rep: Reputation: 2574Reputation: 2574Reputation: 2574Reputation: 2574Reputation: 2574Reputation: 2574Reputation: 2574Reputation: 2574Reputation: 2574Reputation: 2574Reputation: 2574
Quote:
Originally Posted by niaz_ph View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating single realm for multiple sites access mlewis Linux - General 1 07-18-2007 09:27 AM
Multiple Machines behind single Static IP - failing remote ssh Animalector Linux - Security 8 08-18-2005 06:01 PM
Creating multiple users in Kmail with a single KDE user jonole Linux - Software 3 10-03-2004 12:36 AM
sedmail, multiple domains, no user boxes Bake-SaleNet Linux - Networking 0 01-20-2004 02:30 AM


All times are GMT -5. The time now is 11:52 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration