Notices


Reply
Thread Tools
F2thaK's Avatar
Posts: 4,365 | Thanked: 2,463 times | Joined on Jan 2010 @ Australia Mate
#1
Lost SSH Root Access? Let me help you!


I spent a while figuring this problem out.
I access my N9 via SSH through Wifi using WinSCP on my PC. I like to modify my device(s) so I do it as root.
Recently there was an update to SSH on N9 which disables root access through SSH. Problem is, you need to be root to enable it. If youre like me and have come across this problem, let me help you. Then PR1.1 has disabled root access in another config file.



Pre PR1.1

1. open xterm
2. devel-su [enter] then your root password [enter]
3. nano /etc/ssh/sshd_config

then use the arrowkeys on the virtualkeyboard to navigate the file to "Authentication" section and change 'permitRootLogin' to yes

Code:
# Authentication:
PermitRootLogin yes
once done, ctrl+o then enter saves the file
ctrl+x closes Nano

------------------------------------------------------------------------

Post PR1.1, to enable remote root login again (or rather make it controllable via
/etc/ssh/sshd_config like before):


Code:
echo -e 'mkdir -m 0755 -p /var/run/sshd\nexec /usr/sbin/sshd $SSHD_OPTS' >> /etc/default/ssh
pkill -9 /usr/sbin/sshd
and reboot.

Last edited by F2thaK; 2011-11-15 at 13:15.
 

The Following 10 Users Say Thank You to F2thaK For This Useful Post:
HtheB's Avatar
Moderator | Posts: 3,422 | Thanked: 5,819 times | Joined on Dec 2009 @ Bize Her Yer Trabzon
#2
Did you try out the default password "rootme" (without quotes ofcourse)

Do you have the Terminal app on your N9?

if so:
try:
devel-su
rootme
__________________
www.HtheB.com
Please donate if you think I'm doing a good job.
 
F2thaK's Avatar
Posts: 4,365 | Thanked: 2,463 times | Joined on Jan 2010 @ Australia Mate
#3
I reset the root password. I know what it is/was/should be, but it doesnt work! Had the password saved in WinSCP, it worked, rebooted phone and straight away tried logging in again, no longer works!
 
Posts: 30 | Thanked: 14 times | Joined on Mar 2010
#4
Originally Posted by F2thaK View Post
I reset the root password. I know what it is/was/should be, but it doesnt work! Had the password saved in WinSCP, it worked, rebooted phone and straight away tried logging in again, no longer works!
Did you update SSH? The new one disables root logins. Edit /etc/ssh/sshd_config and change "PermitRootLogin no" to "PermitRootLogin yes".
 

The Following User Says Thank You to uber For This Useful Post:
Posts: 1,283 | Thanked: 2,239 times | Joined on May 2011
#5
Better also don't do that. Disabling root ssh access is a good feature. Just enable ssh access for the "user" user, and then escalate your privileges with devel-su.

In terminal:

Code:
devel-su
passwd user
Set your password for "user". Then for remote ssh access:
Code:
ssh user@<your_ip>
devel-su
And that's it. Also probably worth while to change root's password as well.

Last edited by shmerl; 2011-11-03 at 17:16.
 

The Following 5 Users Say Thank You to shmerl For This Useful Post:
F2thaK's Avatar
Posts: 4,365 | Thanked: 2,463 times | Joined on Jan 2010 @ Australia Mate
#6
Originally Posted by uber View Post
Did you update SSH? The new one disables root logins. Edit /etc/ssh/sshd_config and change "PermitRootLogin no" to "PermitRootLogin yes".
yes, I did update! only problem is editing that file..

---

Originally Posted by shmerl View Post
Better also don't do that. Disabling root ssh access is a good feature. Just enable ssh access for the "user" user, and then escalate your privileges with devel-su.

In terminal:

Code:
devel-su
passwd user
Set your password for "user". Then for remote ssh access:
Code:
ssh user@<your_ip>
devel-su
And that's it. Also probably worth while to change root's password as well.
I need root access to be able to modify files in root directory.
 
Posts: 1,283 | Thanked: 2,239 times | Joined on May 2011
#7
To enable devel-su switch on developer mode in system Settings > Security. After that you'll be able to use devel-su in the terminal with root password.
 

The Following User Says Thank You to shmerl For This Useful Post:
F2thaK's Avatar
Posts: 4,365 | Thanked: 2,463 times | Joined on Jan 2010 @ Australia Mate
#8
Originally Posted by uber View Post
Did you update SSH? The new one disables root logins. Edit /etc/ssh/sshd_config and change "PermitRootLogin no" to "PermitRootLogin yes".
can someone please tell me how to make this change in xterm? I was going to do it with MC but I cannot install that as I need root privileges....!
 
Posts: 30 | Thanked: 14 times | Joined on Mar 2010
#9
Originally Posted by F2thaK View Post
can someone please tell me how to make this change in xterm? I was going to do it with MC but I cannot install that as I need root privileges....!
Following shmerl's advice is the better way to go. It will give you root access. However, if you must login directly as root, use vi to edit the file, but you'll need to be root first.
 
F2thaK's Avatar
Posts: 4,365 | Thanked: 2,463 times | Joined on Jan 2010 @ Australia Mate
#10
ive enabled developer mode, set my own user and root passwords, now the ssh update has disabled root, how the hell am I meant to enable it? I need to be root to enable it, but I cant because Im not root, and I cant become root as its disabled?! can you see my predicament? this is a poor developer device, OMG!

any help is appreciated.

edit: I can login as user via SSH still, no probs.

Last edited by F2thaK; 2011-11-04 at 04:48.
 

The Following 2 Users Say Thank You to F2thaK For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 15:21.