You are not logged in.

#1 2016-01-12 18:42:56

VE6CPU
Member
Registered: 2016-01-12
Posts: 8

transfer users from linux mint 17.3

Hello.  I'm installing Arch and everything is going great.  Takes a bit of learning after being with a Debian type system for a while.  I run a old school BBS and would like to transfer my users from the Linux Mint 17.3 to Arch.  I've copied their user directories and all of their files.  I've also move them from the old /etc/passwd, /etc/shadow, /etc/group, /etc/gshadow files and pasted them in to the arch linux ones.  None of the UID:GID conflict.  When I try loggin in with my old username it fails.  Any hints as to what might be wrong?

Thanks.

Offline

#2 2016-01-12 18:53:26

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: transfer users from linux mint 17.3

Welcome to the Arch Linux forums!

VE6CPU wrote:

When I try loggin in with my old username it fails.  Any hints as to what might be wrong?

My hint: something might be wrong¹ tongue

EDIT

As I assume that the system doesn't accept the way you've set up your user - what is the output of this?

getent passwd <youruser>
getent group <youruser>

____
¹ How do you try to login? How does it fail? Is there a message? If there is one, what is it? Does it not accept the credentials? If so, have you tried setting a new password? Or can you log in, but then it "doesn't work"? Might it be your shell initialisation (.zshenv/.zlogin/.zprofile/.zshrc/.bash_profile/.bashrc/.profile)?

Last edited by ayekat (2016-01-12 18:57:26)


pkgshackscfgblag

Offline

#3 2016-01-12 18:56:51

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,452
Website

Re: transfer users from linux mint 17.3

You shouldn't manually modify /etc/passwd or /etc/shadow.  They each have backup versions which the proper tools keep up.

Instead, just move the user directories, then use the useradd command properly to add users and just specify the existing directories rather than creating a new one.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

#4 2016-01-12 19:35:54

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,362

Re: transfer users from linux mint 17.3

Maybe their filesystem or related packages is different in implementation and you can't just cut and paste or copy the files and reuse them.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#5 2016-01-12 20:14:29

VE6CPU
Member
Registered: 2016-01-12
Posts: 8

Re: transfer users from linux mint 17.3

ayekat wrote:

Welcome to the Arch Linux forums!

VE6CPU wrote:

When I try loggin in with my old username it fails.  Any hints as to what might be wrong?

My hint: something might be wrong¹ tongue

EDIT

As I assume that the system doesn't accept the way you've set up your user - what is the output of this?

getent passwd <youruser>
getent group <youruser>

____
¹ How do you try to login? How does it fail? Is there a message? If there is one, what is it? Does it not accept the credentials? If so, have you tried setting a new password? Or can you log in, but then it "doesn't work"? Might it be your shell initialisation (.zshenv/.zlogin/.zprofile/.zshrc/.bash_profile/.bashrc/.profile)?

I've tried using both telnet and ssh.  I'm pretty sure it's related to how Arch authenticates that is different then Mint.  When using SSH it just gives a Access denied error and in the log is:

Jan 12 13:07:33 dionysis sshd[24674]: Failed password for "username" from 142.59.xxx.xxx port 63775 ssh2

getent passwd for that using returns the users line from the passwd file.  The group is empty as they are not apart of a group.  This worked in Mint and Ubuntu.  I'm not sure how to get any more debug information out of ssh or telnet to figure out where it's failing.

Offline

#6 2016-01-12 20:34:47

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: transfer users from linux mint 17.3

VE6CPU wrote:

The group is empty as they are not apart of a group.

If I recall correctly, a user has at least a primary group, so your passwd line presumably contains a user ID and a group ID, which should correspond to an entry in /etc/group (it's possible you've got the same problem for /etc/shadow).
But as Trilby has noted, if you are using the files in /etc, there are also the backup files for passwd, group and shadow, and you might potentially run into further issues.

Have you tried changing the password for that user and see whether you can log in that way?

Otherwise, a simple way to check for inconsistencies among those files is to use `pwck` and `grpck`.


pkgshackscfgblag

Offline

#7 2016-01-12 20:53:13

VE6CPU
Member
Registered: 2016-01-12
Posts: 8

Re: transfer users from linux mint 17.3

Yes each of the users has a group id in passwd.  Currently it is set to 1001.  In my group file it shows bbs:x:1001:.  I ran the pwck and grpck and both show no output.  I did have one user that their home directory was not created so I created it and changed it's permissions.  The back up files look exactly the same as the originals.  I tried changing the users password but still won't let me in.  I'll keep looking for answers.  Thanks for all of the help.

Offline

#8 2016-01-12 21:07:12

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: transfer users from linux mint 17.3

VE6CPU wrote:

In my group file it shows bbs:x:1001:

That's not very consistent in my opinion, but perhaps grpck doesn't check that...
What are the permissions on the files (/etc/group, /etc/shadow, /etc/passwd)? They should be 644, 000, 644, respectively.


pkgshackscfgblag

Offline

#9 2016-01-12 21:07:54

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,740

Re: transfer users from linux mint 17.3

The big problem with the suggestions thus far is that the original poster (I'm guessing) does not know the passwords for all of the users of his system.   The only way I can think to do this without resetting everyone's password is to hand copy the files.  I suppose one could copy just the salt values and hashes from shadow and merge those with Arch's files.

This article describes the hashing and salting of passwords fairly well : http://www.slashroot.in/how-are-passwor … adow-utils

What messages are being logged to the journal?  Are the login shells in the same place on Arch as they are on Mint?  Does Arch accept the same hash methods as does Mint?

Edit:  The login shell locations are not your problem.   I note that Arch uses $6 for the hash which means the SHA-512 Algorithm

Last edited by ewaller (2016-01-12 21:11:13)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Online

#10 2016-01-12 21:15:58

VE6CPU
Member
Registered: 2016-01-12
Posts: 8

Re: transfer users from linux mint 17.3

All three are set to 644 (-rw-r--r--).

I don't know the users passwords.  I did hand copy just the users from the Mint passwd, shadow and group files.  Here is a sample from the passwd file:

sysop:x:1003:1001:Stephen Atkins:/opt/mbse/home/sysop:/opt/mbse/bin/mbsebbs

As you can see it doesn't use the standard /bin/bash as the shell.  I'm starting to wonder if there is a problem when ssh tries to hand over control to /opt/mbse/bin/mbsebbs.  I've set loglevel in sshd to verbose but it's not saying anything like that.  If I change the user to use the /bin/bash shell they can log in and get to a shell.  I've double checked the permissions on their home directories (/opt/mbse/home/sysop) and they are correct and have 770 permissions.

Offline

#11 2016-01-12 21:19:21

VE6CPU
Member
Registered: 2016-01-12
Posts: 8

Re: transfer users from linux mint 17.3

I copied the original line from my old shadow and changed that user to use /bin/bash and I can login with ssh.  It must be something to do with it calling that other program as as shell.  Not sure what that might be but it's a start.

Offline

#12 2016-01-12 21:26:19

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: transfer users from linux mint 17.3

VE6CPU wrote:

I'm starting to wonder if there is a problem when ssh tries to hand over control to /opt/mbse/bin/mbsebbs.

On Mint, did you modify /etc/shells to make that work? As to my knowledge, if that path is not in /etc/shells, it won't be accepted as a login application.

All three are set to 644 (-rw-r--r--).

Try setting /etc/shadow to 400.
EDIT Scratch this, I see the login shell was the problem (although it's still a good idea to limit access to /etc/shadow to root only).

But yes, I'm running out of ideas. There's a myriad of other things that might cause issues.

Last edited by ayekat (2016-01-12 21:27:26)


pkgshackscfgblag

Offline

#13 2016-01-12 21:34:20

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,740

Re: transfer users from linux mint 17.3

I am going to breach the rules a little and ask if there is any one account from your old system for which you would be willing to share the corresponding line from /etc/passwd and from /etc/shadow.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Online

#14 2016-01-12 21:47:36

VE6CPU
Member
Registered: 2016-01-12
Posts: 8

Re: transfer users from linux mint 17.3

Sure why the heck not.  I can always delete it.

watkins:x:1097:1001:William:/opt/mbse/home/watkins:/opt/mbse/bin/mbsebbs
watkins:$1$jdr0uN5S$046Qpoi6IDcIDVwCu47sC.:16790:0:99999:7:::

Now I know the first thing is that this user is not using the default $6 like some of the others.  When you create a user for MBSE BBS it uses $1 as the default.  I know it's not as secure but...

Ayekat:  Just looked at /etc/shells from my Mint install and that shell is not in there.  I will add it to the ArchLinux /etc/shells and see what happens.  And its not giving me this in the system log:

Jan 12 14:45:21 dionysis sshd[25415]: Accepted password for sysop from 142.59.254.81 port 49534 ssh2
Jan 12 14:45:21 dionysis sshd[25415]: pam_unix(sshd:session): session opened for user sysop by (uid=0)
Jan 12 14:45:21 dionysis systemd[1]: Created slice User Slice of sysop.
Jan 12 14:45:21 dionysis systemd[1]: Starting User Manager for UID 1003...
Jan 12 14:45:21 dionysis systemd[25417]: user@1003.service: Failed at step CGROUP spawning /usr/lib/systemd/systemd: No such file or directory
Jan 12 14:45:21 dionysis systemd-logind[253]: New session c29 of user sysop.
Jan 12 14:45:21 dionysis systemd[1]: Started User Manager for UID 1003.
Jan 12 14:45:21 dionysis systemd[1]: Started Session c29 of user sysop.
Jan 12 14:45:21 dionysis sshd[25415]: pam_unix(sshd:session): session closed for user sysop
Jan 12 14:45:21 dionysis systemd-logind[253]: Removed session c29.
Jan 12 14:45:21 dionysis systemd[1]: Stopped User Manager for UID 1003.
Jan 12 14:45:21 dionysis systemd[1]: Removed slice User Slice of sysop.

That was when their shell was set to /opt/mbse/bin/mbsebbs

Now when I set it to /bin/bash it is a successful login and gives me:
Jan 12 14:46:45 dionysis sshd[25423]: Accepted password for sysop from 142.59.254.81 port 49552 ssh2
Jan 12 14:46:45 dionysis sshd[25423]: pam_unix(sshd:session): session opened for user sysop by (uid=0)
Jan 12 14:46:45 dionysis systemd[1]: Created slice User Slice of sysop.
Jan 12 14:46:45 dionysis systemd[1]: Starting User Manager for UID 1003...
Jan 12 14:46:45 dionysis systemd-logind[253]: New session c30 of user sysop.
Jan 12 14:46:45 dionysis systemd[1]: Started Session c30 of user sysop.
Jan 12 14:46:45 dionysis systemd[25425]: pam_unix(systemd-user:session): session opened for user sysop by (uid=0)
Jan 12 14:46:45 dionysis systemd[25425]: Reached target Paths.
Jan 12 14:46:45 dionysis systemd[25425]: Reached target Timers.
Jan 12 14:46:45 dionysis systemd[25425]: Starting D-Bus User Message Bus Socket.
Jan 12 14:46:45 dionysis systemd[25425]: Listening on Sound System.
Jan 12 14:46:45 dionysis systemd[25425]: Listening on D-Bus User Message Bus Socket.
Jan 12 14:46:45 dionysis systemd[25425]: Reached target Sockets.
Jan 12 14:46:45 dionysis systemd[25425]: Reached target Basic System.
Jan 12 14:46:45 dionysis systemd[25425]: Reached target Default.
Jan 12 14:46:45 dionysis systemd[25425]: Startup finished in 23ms.
Jan 12 14:46:45 dionysis systemd[1]: Started User Manager for UID 1003.

Offline

#15 2016-01-12 22:03:44

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,740

Re: transfer users from linux mint 17.3

Take a look at /etc/pam.d.system-auth
I have a hunch that if you find the line

password  required  pam_unix.so     try_first_pass nullok sha512 shadow

and remove the sha512, it might work.   If my hunch is right, that is requiring a SHA-2 512 bit hash.  Removing that option weakens your system a little, but not much.  I think it will allow the weaker MD5 hash you are using, but new hashes will still be 512.

This is all conjecture YMMV.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Online

#16 2016-01-13 06:02:00

severach
Member
Registered: 2015-05-23
Posts: 192

Re: transfer users from linux mint 17.3

Hand delete one of the users you know the info for and create them with the proper tools. Find the difference and you can fix the rest of the users.

Offline

#17 2016-01-13 06:25:48

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,362

Re: transfer users from linux mint 17.3

Maybe it's just a user error, you need to replace your users. 
Just couldn't resist. 
Usually the UID matching is all that is needed at least once the user gets logged in/logging in.
Take your login that you've used on Mint, and then make your user in some way high UID that stays away from what you're trying to merge onto Arch.
See if the shadow is the same result after you set the passwd to it using the same password you're using on Mint now.

Last edited by nomorewindows (2016-01-13 06:30:04)


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

Board footer

Powered by FluxBB