![]() |
#1 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 608
Karma: 1588610
Join Date: Jan 2012
Device: Kindle Scribe
|
Problem with passwd and ssh
I was trying to change the home dir for root from /tmp/root to /home/root and made the edits to /etc/passwd. I am now unable to ssh into my kindle as it rejects the password. The thing is, if I use the kindle XTerm, and type in 'login', enter in root as user and my password, it works. How can I get the ssh working again?
Also, if I restore the original passwd file, it gets back to normal Last edited by aditya3098; 07-11-2012 at 07:51 AM. |
![]() |
![]() |
![]() |
#2 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
My K5 does not have a /home directory. Perhaps you should make it /mnt/us/home/root? |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 608
Karma: 1588610
Join Date: Jan 2012
Device: Kindle Scribe
|
I created both /home and /home/root
As iv'e mentioned, it worked on XTERM |
![]() |
![]() |
![]() |
#4 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
Why not use /mnt/us/root instead? Last edited by geekmaster; 07-11-2012 at 09:53 AM. |
|
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
|
It shouldn't.
But since xterm access is in place, I'd suggest running the SSH daemon in foreground and debugging mode to see what's going on. Also, on the client side debug output would be useful to see in what stage of SSH handshake it breaks. For the OpenSSH client, hand it the "-vvv" switch and it will output verbose information (please don't copy verbatim in a post, at least use a Spoiler section here in the forum). The server would have to be killed and started again (or run a second instance on another port). The OpenSSH server knows about the "-d" flag and it will not go to background and report information. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 608
Karma: 1588610
Join Date: Jan 2012
Device: Kindle Scribe
|
I can't have /mnt/us/root because I want to store synlinks in my home dir. Also, even if I just modify my shell from /bin/sh to /bin/bash (from that bash for kindle thread), It still won't work. Absolutely any change to /etc/passwd disables ssh.
|
![]() |
![]() |
![]() |
#7 | |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
It is not located under the /home sub-tree. To move it (which may break other things) you need to change the home directory field of /etc/passwd And it reads as if you did that part. The ssh server looks for the matching key in ~/.ssh/authorized_keys Where home (~) is set to /home/<username> except for username "root". Which could be a lookup of /etc/passwd but is more likely hard coded in the ssh server as: /root Mainly because the home directory of the administrator hasn't changed since K&R (plus others) wrote Unix. But if your going to move the home directory of root, then you need to move its entire contents (including hidden directories like: .ssh and its contents). Translation: It reads as if you left the .ssh/authorized_keys file behind when you moved root. Last edited by knc1; 07-11-2012 at 10:24 AM. |
|
![]() |
![]() |
![]() |
#8 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 608
Karma: 1588610
Join Date: Jan 2012
Device: Kindle Scribe
|
There IS no .ssh directory. The root gets wiped at every reboot, too (/var/tmp/root, that's why I changed it in the first place)
|
![]() |
![]() |
![]() |
#9 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
|
![]() |
![]() |
![]() |
#10 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 608
Karma: 1588610
Join Date: Jan 2012
Device: Kindle Scribe
|
Oh, by "password was rejected" I ment the password came out as invalid
Code:
aditya@aditya-desktop:~$ ssh root@192.168.1.5 root@192.168.1.5's password: Permission denied, please try again. root@192.168.1.5's password: Permission denied, please try again. root@192.168.1.5's password: Permission denied (publickey,password). aditya@aditya-desktop:~$ I am guessing it's something to do with the /etc/shadow file |
![]() |
![]() |
![]() |
#11 | |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
The ssh server does use /etc/password and /etc/shadow for "password authentication". |
|
![]() |
![]() |
![]() |
#12 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 608
Karma: 1588610
Join Date: Jan 2012
Device: Kindle Scribe
|
How do you update the shadow file? There was something on pwconv but that needs debian, right? And libSElinux?
|
![]() |
![]() |
![]() |
#13 | |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
*or* Do you have Linux on any other machine? Just cut and paste the "root" line of /etc/shadow from the machine with the password you know to the Kindle. |
|
![]() |
![]() |
![]() |
#14 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Cut/paste will keep the original 8-character DES password. "passwd root" will create a new MD5 password. When logging in with a DES password, and characters entered past 8 are ignored.
|
![]() |
![]() |
![]() |
#15 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
True, but so what? Just as long as the user knows what the clear text password is.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
SSH Help | Jongwe | Kindle Developer's Corner | 75 | 04-13-2019 06:26 PM |
Need SSH help | ijoecoles | Kindle Developer's Corner | 18 | 06-19-2012 09:50 AM |
Locked out of ssh, No 3g HELP! | tstngry | Amazon Kindle | 5 | 04-27-2012 02:28 AM |
how to ssh into Kindle | thomass | Amazon Kindle | 4 | 04-11-2011 10:48 AM |
SSH to Kindle | Zorz | Kindle Developer's Corner | 16 | 01-15-2010 01:18 AM |