LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 06-10-2010, 07:11 PM   #1
ganesh_k
LQ Newbie
 
Registered: Dec 2003
Location: Chennai,India
Distribution: Ubuntu
Posts: 11

Rep: Reputation: 0
Importing user accounts/passwords from another linux machine


I have couple of users in one machine. I can access the /etc/passwd,/etc/shadow and /etc/group files in this box. I have another box. I want to create some user accounts in the second box by just looking in the passwd, shadow and group files in the first box. I would just copy over the corresponding lines into the corresponding for whichever accounts I want to create as new and also change the lines for which I want to update the account information. Is this possible and will also the passwords work fine? Please also let me know there is any good tool for automatically doing this kind of stuff. Both the boxes that I have are Ubuntu machines though one is running Ubuntu 8.04 and the other is 10.04. Thanks in advance!

Thanks,
Ganesh
 
Old 06-10-2010, 07:14 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,328

Rep: Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471
Quote:
Originally Posted by ganesh_k View Post
I have couple of users in one machine. I can access the /etc/passwd,/etc/shadow and /etc/group files in this box. I have another box. I want to create some user accounts in the second box by just looking in the passwd, shadow and group files in the first box. I would just copy over the corresponding lines into the corresponding for whichever accounts I want to create as new and also change the lines for which I want to update the account information. Is this possible and will also the passwords work fine? Please also let me know there is any good tool for automatically doing this kind of stuff. Both the boxes that I have are Ubuntu machines though one is running Ubuntu 8.04 and the other is 10.04. Thanks in advance!

Thanks,
Ganesh
Possible? Yes. A good idea? No.

Create a script to add the missing users/groups on the new box, and be done with it. And that's only really a good idea, if you've got LOTS (like over 100) users to add. Otherwise, it's a waste of time. The groupadd and useradd commands are not hard to use.
 
1 members found this post helpful.
Old 06-10-2010, 07:29 PM   #3
ganesh_k
LQ Newbie
 
Registered: Dec 2003
Location: Chennai,India
Distribution: Ubuntu
Posts: 11

Original Poster
Rep: Reputation: 0
Thanks for the reply TBOne. But I would also want to create the users in the second box with the exact passwords as in the first one and I don't know the passwords. So I don't think I can do this manually using the useradd or groupadd commands. Am I right?
 
Old 06-10-2010, 08:57 PM   #4
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 4,728

Rep: Reputation: 754Reputation: 754Reputation: 754Reputation: 754Reputation: 754Reputation: 754Reputation: 754
Install a NIS server.

jlinkels
 
1 members found this post helpful.
Old 06-11-2010, 01:54 AM   #5
ganesh_k
LQ Newbie
 
Registered: Dec 2003
Location: Chennai,India
Distribution: Ubuntu
Posts: 11

Original Poster
Rep: Reputation: 0
Smile NIS server

Quote:
Originally Posted by jlinkels View Post
Install a NIS server.

jlinkels
Thanks very much jlinkels! I didn't know about NIS. Nice to hear about it now. I will see if I can use it.
 
Old 06-11-2010, 09:11 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,328

Rep: Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471
Quote:
Originally Posted by ganesh_k View Post
Thanks for the reply TBOne. But I would also want to create the users in the second box with the exact passwords as in the first one and I don't know the passwords. So I don't think I can do this manually using the useradd or groupadd commands. Am I right?
NIS (or LDAP) are options.

And you CAN specify a password on the command line. Read the man page for the useradd command, pay attention to the -p option. Changing the default method of authentication to migrate from one system to a new one, is alot of work. Again, you don't say how many users, but if it's just a few, tell them to pick new passwords. Set everyone a default password, and tell them to use it the first time. After login, it'll prompt them to change it. Problem solved.
 
1 members found this post helpful.
  


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
created user picks up machine accounts chozz Linux - General 0 08-22-2008 10:16 AM
How to forge Linux to use MySQL for user accounts and passwords. NaCo Linux - Security 1 06-01-2008 11:29 AM
using one machine to serve the home directory and user accounts shishirkotkar Linux - Software 7 05-04-2008 09:42 PM
Request : set passwords for many users [user accounts exist] using a shell script bv_uma Linux - Software 3 08-19-2006 10:01 AM
Is there a way to sync Samba passwords with linux user passwords MarleyGPN Linux - Networking 2 09-09-2003 11:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:17 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration