View Single Post
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