maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   MeeGo / Harmattan (https://talk.maemo.org/forumdisplay.php?f=45)
-   -   Lost SSH Root Access? Let me help you! (https://talk.maemo.org/showthread.php?t=79645)

F2thaK 2011-11-03 12:42

Lost SSH Root Access? Let me help you!
 
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.

HtheB 2011-11-03 13:35

Re: Root Password Problem
 
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

F2thaK 2011-11-03 13:43

Re: Root Password Problem
 
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!

uber 2011-11-03 16:14

Re: Root Password Problem
 
Quote:

Originally Posted by F2thaK (Post 1117814)
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".

shmerl 2011-11-03 17:09

Re: Root Password Problem
 
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.

F2thaK 2011-11-03 23:25

Re: Root Password Problem
 
Quote:

Originally Posted by uber (Post 1117865)
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..

---

Quote:

Originally Posted by shmerl (Post 1117886)
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.

shmerl 2011-11-04 01:56

Re: Root Password Problem
 
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.

F2thaK 2011-11-04 04:24

Re: Root Password Problem
 
Quote:

Originally Posted by uber (Post 1117865)
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....! :mad::(:confused:

uber 2011-11-04 04:40

Re: Root Password Problem
 
Quote:

Originally Posted by F2thaK (Post 1118116)
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....! :mad::(:confused:

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 2011-11-04 04:45

Re: Root Password Problem
 
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.


All times are GMT. The time now is 03:55.

vBulletin® Version 3.8.8