When I copy /etc/shadow to another system, is it possible to login with the according passwords?

Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I am asking, because I generated a live CD using the hash from an existing /etc/shadow, assuming I will then be able to login with the corresponding password, but apparently login fails.
linux password shadow
add a comment |Â
up vote
3
down vote
favorite
I am asking, because I generated a live CD using the hash from an existing /etc/shadow, assuming I will then be able to login with the corresponding password, but apparently login fails.
linux password shadow
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I am asking, because I generated a live CD using the hash from an existing /etc/shadow, assuming I will then be able to login with the corresponding password, but apparently login fails.
linux password shadow
I am asking, because I generated a live CD using the hash from an existing /etc/shadow, assuming I will then be able to login with the corresponding password, but apparently login fails.
linux password shadow
edited Oct 30 '17 at 17:49
G-Man
11.6k82657
11.6k82657
asked Oct 30 '17 at 15:09
user569825
28229
28229
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
6
down vote
accepted
It's possible if
- the target system uses shadow passwords, and
/etc/shadowis not overridden by other mechanisms (viaPAM,nss, etc.), and- the target system doesn't hash
/etc/shadow, and - the target system has the same usernames as the source system, and
- the UIDs on the target system are the same as the UIDs on the source system, and
- the encryption methods used by the passwords need to be supported on the target system, and
/etc/passwdâÂÂon the target system must be in sync with the injected/etc/shadow.
I hope I didn't forget anything. :)
The easier (and safer) way to do it is to use vipw to save credentials for the relevant users on the source system, then copy them on the target system
Multiple encryption methods are available in glibc.
â Christopher
Oct 30 '17 at 15:50
Yes, the encryption methods used by the passwords need to be supported on the target system. That's unlikely to be a problem these days.
â Satà  Katsura
Oct 30 '17 at 16:03
ItâÂÂs implied by your #4 and #5, but it might be clearer if you explicitly said that the/etc/passwdâ on the target system must be in sync with the injected/etc/shadow.
â G-Man
Oct 30 '17 at 17:47
@G-Man Edited. Now it's redundant, but oh well. :)
â Satà  Katsura
Oct 30 '17 at 17:49
To move users and their passwords, I found it easiest to create them on the new system, and thengreptheir entries fromshadow:egrep "^(jane|joe):" /etc/shadow. Then do a replace inshadow.
â hschou
Oct 31 '17 at 7:08
 |Â
show 3 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
accepted
It's possible if
- the target system uses shadow passwords, and
/etc/shadowis not overridden by other mechanisms (viaPAM,nss, etc.), and- the target system doesn't hash
/etc/shadow, and - the target system has the same usernames as the source system, and
- the UIDs on the target system are the same as the UIDs on the source system, and
- the encryption methods used by the passwords need to be supported on the target system, and
/etc/passwdâÂÂon the target system must be in sync with the injected/etc/shadow.
I hope I didn't forget anything. :)
The easier (and safer) way to do it is to use vipw to save credentials for the relevant users on the source system, then copy them on the target system
Multiple encryption methods are available in glibc.
â Christopher
Oct 30 '17 at 15:50
Yes, the encryption methods used by the passwords need to be supported on the target system. That's unlikely to be a problem these days.
â Satà  Katsura
Oct 30 '17 at 16:03
ItâÂÂs implied by your #4 and #5, but it might be clearer if you explicitly said that the/etc/passwdâ on the target system must be in sync with the injected/etc/shadow.
â G-Man
Oct 30 '17 at 17:47
@G-Man Edited. Now it's redundant, but oh well. :)
â Satà  Katsura
Oct 30 '17 at 17:49
To move users and their passwords, I found it easiest to create them on the new system, and thengreptheir entries fromshadow:egrep "^(jane|joe):" /etc/shadow. Then do a replace inshadow.
â hschou
Oct 31 '17 at 7:08
 |Â
show 3 more comments
up vote
6
down vote
accepted
It's possible if
- the target system uses shadow passwords, and
/etc/shadowis not overridden by other mechanisms (viaPAM,nss, etc.), and- the target system doesn't hash
/etc/shadow, and - the target system has the same usernames as the source system, and
- the UIDs on the target system are the same as the UIDs on the source system, and
- the encryption methods used by the passwords need to be supported on the target system, and
/etc/passwdâÂÂon the target system must be in sync with the injected/etc/shadow.
I hope I didn't forget anything. :)
The easier (and safer) way to do it is to use vipw to save credentials for the relevant users on the source system, then copy them on the target system
Multiple encryption methods are available in glibc.
â Christopher
Oct 30 '17 at 15:50
Yes, the encryption methods used by the passwords need to be supported on the target system. That's unlikely to be a problem these days.
â Satà  Katsura
Oct 30 '17 at 16:03
ItâÂÂs implied by your #4 and #5, but it might be clearer if you explicitly said that the/etc/passwdâ on the target system must be in sync with the injected/etc/shadow.
â G-Man
Oct 30 '17 at 17:47
@G-Man Edited. Now it's redundant, but oh well. :)
â Satà  Katsura
Oct 30 '17 at 17:49
To move users and their passwords, I found it easiest to create them on the new system, and thengreptheir entries fromshadow:egrep "^(jane|joe):" /etc/shadow. Then do a replace inshadow.
â hschou
Oct 31 '17 at 7:08
 |Â
show 3 more comments
up vote
6
down vote
accepted
up vote
6
down vote
accepted
It's possible if
- the target system uses shadow passwords, and
/etc/shadowis not overridden by other mechanisms (viaPAM,nss, etc.), and- the target system doesn't hash
/etc/shadow, and - the target system has the same usernames as the source system, and
- the UIDs on the target system are the same as the UIDs on the source system, and
- the encryption methods used by the passwords need to be supported on the target system, and
/etc/passwdâÂÂon the target system must be in sync with the injected/etc/shadow.
I hope I didn't forget anything. :)
The easier (and safer) way to do it is to use vipw to save credentials for the relevant users on the source system, then copy them on the target system
It's possible if
- the target system uses shadow passwords, and
/etc/shadowis not overridden by other mechanisms (viaPAM,nss, etc.), and- the target system doesn't hash
/etc/shadow, and - the target system has the same usernames as the source system, and
- the UIDs on the target system are the same as the UIDs on the source system, and
- the encryption methods used by the passwords need to be supported on the target system, and
/etc/passwdâÂÂon the target system must be in sync with the injected/etc/shadow.
I hope I didn't forget anything. :)
The easier (and safer) way to do it is to use vipw to save credentials for the relevant users on the source system, then copy them on the target system
edited Oct 31 '17 at 6:12
answered Oct 30 '17 at 15:47
Satà  Katsura
10.7k11533
10.7k11533
Multiple encryption methods are available in glibc.
â Christopher
Oct 30 '17 at 15:50
Yes, the encryption methods used by the passwords need to be supported on the target system. That's unlikely to be a problem these days.
â Satà  Katsura
Oct 30 '17 at 16:03
ItâÂÂs implied by your #4 and #5, but it might be clearer if you explicitly said that the/etc/passwdâ on the target system must be in sync with the injected/etc/shadow.
â G-Man
Oct 30 '17 at 17:47
@G-Man Edited. Now it's redundant, but oh well. :)
â Satà  Katsura
Oct 30 '17 at 17:49
To move users and their passwords, I found it easiest to create them on the new system, and thengreptheir entries fromshadow:egrep "^(jane|joe):" /etc/shadow. Then do a replace inshadow.
â hschou
Oct 31 '17 at 7:08
 |Â
show 3 more comments
Multiple encryption methods are available in glibc.
â Christopher
Oct 30 '17 at 15:50
Yes, the encryption methods used by the passwords need to be supported on the target system. That's unlikely to be a problem these days.
â Satà  Katsura
Oct 30 '17 at 16:03
ItâÂÂs implied by your #4 and #5, but it might be clearer if you explicitly said that the/etc/passwdâ on the target system must be in sync with the injected/etc/shadow.
â G-Man
Oct 30 '17 at 17:47
@G-Man Edited. Now it's redundant, but oh well. :)
â Satà  Katsura
Oct 30 '17 at 17:49
To move users and their passwords, I found it easiest to create them on the new system, and thengreptheir entries fromshadow:egrep "^(jane|joe):" /etc/shadow. Then do a replace inshadow.
â hschou
Oct 31 '17 at 7:08
Multiple encryption methods are available in glibc.
â Christopher
Oct 30 '17 at 15:50
Multiple encryption methods are available in glibc.
â Christopher
Oct 30 '17 at 15:50
Yes, the encryption methods used by the passwords need to be supported on the target system. That's unlikely to be a problem these days.
â Satà  Katsura
Oct 30 '17 at 16:03
Yes, the encryption methods used by the passwords need to be supported on the target system. That's unlikely to be a problem these days.
â Satà  Katsura
Oct 30 '17 at 16:03
ItâÂÂs implied by your #4 and #5, but it might be clearer if you explicitly said that the
/etc/passwdâ on the target system must be in sync with the injected /etc/shadow.â G-Man
Oct 30 '17 at 17:47
ItâÂÂs implied by your #4 and #5, but it might be clearer if you explicitly said that the
/etc/passwdâ on the target system must be in sync with the injected /etc/shadow.â G-Man
Oct 30 '17 at 17:47
@G-Man Edited. Now it's redundant, but oh well. :)
â Satà  Katsura
Oct 30 '17 at 17:49
@G-Man Edited. Now it's redundant, but oh well. :)
â Satà  Katsura
Oct 30 '17 at 17:49
To move users and their passwords, I found it easiest to create them on the new system, and then
grep their entries from shadow: egrep "^(jane|joe):" /etc/shadow. Then do a replace in shadow.â hschou
Oct 31 '17 at 7:08
To move users and their passwords, I found it easiest to create them on the new system, and then
grep their entries from shadow: egrep "^(jane|joe):" /etc/shadow. Then do a replace in shadow.â hschou
Oct 31 '17 at 7:08
 |Â
show 3 more comments
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f401420%2fwhen-i-copy-etc-shadow-to-another-system-is-it-possible-to-login-with-the-acco%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password