Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 07-11-2012, 07:44 AM   #1
aditya3098
Guru
aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.
 
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.
aditya3098 is offline   Reply With Quote
Old 07-11-2012, 08:13 AM   #2
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by aditya3098 View Post
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
Did you create the /home/root directory?

My K5 does not have a /home directory.

Perhaps you should make it /mnt/us/home/root?
geekmaster is offline   Reply With Quote
Advert
Old 07-11-2012, 09:48 AM   #3
aditya3098
Guru
aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.
 
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
aditya3098 is offline   Reply With Quote
Old 07-11-2012, 09:51 AM   #4
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by aditya3098 View Post
I created both /home and /home/root
As iv'e mentioned, it worked on XTERM
Perhaps SSH wants a writable /home/root?

Why not use /mnt/us/root instead?

Last edited by geekmaster; 07-11-2012 at 09:53 AM.
geekmaster is offline   Reply With Quote
Old 07-11-2012, 09:55 AM   #5
hawhill
Wizard
hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.
 
hawhill's Avatar
 
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.
hawhill is offline   Reply With Quote
Advert
Old 07-11-2012, 10:11 AM   #6
aditya3098
Guru
aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.
 
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.
aditya3098 is offline   Reply With Quote
Old 07-11-2012, 10:21 AM   #7
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by aditya3098 View Post
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
The home directory is /root
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.
knc1 is offline   Reply With Quote
Old 07-11-2012, 10:30 AM   #8
aditya3098
Guru
aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.
 
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)
aditya3098 is offline   Reply With Quote
Old 07-11-2012, 10:36 AM   #9
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by aditya3098 View Post
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)
Then I guess you just answered your own question about why key authentication does not work, only password authentication.
knc1 is offline   Reply With Quote
Old 07-11-2012, 11:04 AM   #10
aditya3098
Guru
aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.
 
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 never used pubkey auth.

I am guessing it's something to do with the /etc/shadow file
aditya3098 is offline   Reply With Quote
Old 07-11-2012, 11:11 AM   #11
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by aditya3098 View Post
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 never used pubkey auth.

I am guessing it's something to do with the /etc/shadow file
Ah, So, I mis-understood.

The ssh server does use /etc/password and /etc/shadow for "password authentication".
knc1 is offline   Reply With Quote
Old 07-11-2012, 11:52 AM   #12
aditya3098
Guru
aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.
 
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?
aditya3098 is offline   Reply With Quote
Old 07-11-2012, 11:55 AM   #13
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by aditya3098 View Post
How do you update the shadow file? There was something on pwconv but that needs debian, right? And libSElinux?
passwd root
*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.
knc1 is offline   Reply With Quote
Old 07-11-2012, 12:11 PM   #14
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by knc1 View Post
passwd root
*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.
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.
geekmaster is offline   Reply With Quote
Old 07-11-2012, 12:12 PM   #15
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
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.
knc1 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 01:43 PM.


MobileRead.com is a privately owned, operated and funded community.