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.

shmerl 2011-11-04 05:01

Re: Root Password Problem
 
No, devel-su should work even after the update. What is disabled is doing: ssh root@localhost for example. Does devel-su fails for you (it should ask for root password and it should work, with whatever you set it to).

If you made some typo while changing the root password - try to figure out what it was, when devel-su asks you for it. Otherwise you might need to reflash it I'm afraid.

F2thaK 2011-11-04 09:38

Re: Root Password Problem
 
in xterm i can do devel-su and it accepts my password, but how do I edit /etc/ssh/sshd_config and change "PermitRootLogin no" to "PermitRootLogin yes" afterwards? I cannot find an app to do this.

Thanks for your help BTW, its really appreciated!

F2thaK 2011-11-04 10:03

Re: Root Password Problem
 
HAHA!!!!!!!! MOFO! fixed it.........................


In xterm:
devel-su
[password]
cd /etc/ssh/
rm sshd_config
mv sshd_config.dpkg.old(?) sshd_config

then reboot


not 100% sure of the file I renamed, it was a backup of the old config file, made when the app was updated.

mooglez 2011-11-04 10:56

Re: Root Password Problem
 
Quote:

Originally Posted by F2thaK (Post 1118189)
in xterm i can do devel-su and it accepts my password, but how do I edit /etc/ssh/sshd_config and change "PermitRootLogin no" to "PermitRootLogin yes" afterwards? I cannot find an app to do this.

Thanks for your help BTW, its really appreciated!

You can install nano from the Nokia store and then as root do

nano /etc/ssh/sshd_config

change the settings you want, for example:

change the port from 22 to something else if you want to enable access from 3G also.

select which IP addresses are allowed to connect.

disable password authentication to use only keybased authentication

enable root login again

etc..

ctrl+o to save, and ctrl+x to quit nano

F2thaK 2011-11-04 11:04

Re: Lost SSH Root Access? Let me help you!
 
I tried nano, i couldnt figure out how to edit files though

mooglez 2011-11-04 11:30

Re: Lost SSH Root Access? Let me help you!
 
Quote:

Originally Posted by F2thaK (Post 1118215)
I tried nano, i couldnt figure out how to edit files though

how did you try to use it?

F2thaK 2011-11-04 11:32

Re: Lost SSH Root Access? Let me help you!
 
I didnt know how to use it

mooglez 2011-11-04 11:35

Re: Lost SSH Root Access? Let me help you!
 
Quote:

Originally Posted by F2thaK (Post 1118224)
I didnt know how to use it

1. open xterm
2. devel-su and then your root password
3. in xterm as root: nano /etc/ssh/sshd_config

then use the arrowkeys on the virtualkeyboard to navigate the file, and modify any settings you want.

once done, ctrl+o and enter saves the file
ctrl+x closes nano

try that

biatch0 2011-11-04 11:41

Re: Lost SSH Root Access? Let me help you!
 
Or use "vi" - comes installed by default.

F2thaK 2011-11-04 11:45

Re: Lost SSH Root Access? Let me help you!
 
ive sorted my prob, thanks

TMavica 2011-11-15 02:17

Re: Lost SSH Root Access? Let me help you!
 
where is the arrow key in virtual keyboard...I cant find it

cddiede 2011-11-15 02:20

Re: Lost SSH Root Access? Let me help you!
 
Quote:

Originally Posted by TMavica (Post 1123708)
where is the arrow key in virtual keyboard...I cant find it

In the terminal application, hit the "menu" icon in the upper right hand corner, then toggle it between shell keys and arrows keys.

coomac 2011-11-15 02:25

Re: Lost SSH Root Access? Let me help you!
 
Also a quick swipe from left to right or from right to left within the terminal will toggle between arrows and shell toolbar.

Faz 2011-11-18 03:51

Re: Lost SSH Root Access? Let me help you!
 
Quote:

Originally Posted by coomac (Post 1123714)
Also a quick swipe from left to right or from right to left within the terminal will toggle between arrows and shell toolbar.

Awesome! Thanks! :)
How the hell did you find this out?

ossipena 2011-11-18 05:09

Re: Lost SSH Root Access? Let me help you!
 
are you sure you want to enable root login?

lets think about it for a while. what do you need to know in order to access your device with superuser access?

1. address of your device

2. password


it probably isn't that hard to guess what is the default password (it is no secret). so if you enable root login via ssh, change the password!

vihru 2011-11-28 17:19

Re: Lost SSH Root Access? Let me help you!
 
please tell me how to make that root access with ssh because that tutorial on first page dont work.. thanks.

vihru 2011-12-05 06:56

Re: Lost SSH Root Access? Let me help you!
 
Quote:

Originally Posted by F2thaK (Post 1118230)
ive sorted my prob, thanks

you get root access now with SSH?

F2thaK 2011-12-05 09:56

Re: Lost SSH Root Access? Let me help you!
 
yes, see first post

vihru 2011-12-05 12:18

Re: Lost SSH Root Access? Let me help you!
 
Quote:

Originally Posted by F2thaK (Post 1133409)
yes, see first post

are you sure that post is right?
because after that my user login on pc dont work anymore.. either root..

Dragoss91 2011-12-16 15:03

Re: Lost SSH Root Access? Let me help you!
 
It's my first time when I have to use winscp with nokia n9 and I can not login , it says "access denied" because of wrong password . I have enabled developer mode .

so far I tried

u = root , p = rootme
u = devel-su , p = rootme

nothing worked ... also with putty I have the same problem :(

litemotiv 2011-12-18 11:22

Re: Lost SSH Root Access? Let me help you!
 
I just enabled developer mode for the first time, but it seems i cannot ssh to/on the phone at all. Either running ssh user@localhost on the phone, or ssh'ing from the lan results in a permission denied (wrong password). I've tried the rootme password, the password displayed in SDK Connect and also a custom password but no dice...

Any idea what i'm missing here? I've also tried restarting the phone but that didn't help either. Sshd is running so that's not the problem

impact 2011-12-18 11:39

Re: Lost SSH Root Access? Let me help you!
 
I seem to recall reading here that root SSH access is disabled after the update. So either create the user "user", set his password with passwd and then try SSH-ing as user or enable root SSH (as detailed in the first post of this thread).

vihru 2011-12-18 11:43

Re: Lost SSH Root Access? Let me help you!
 
there is no way to get it work with full rights?

that i can make files with ssh connection and edit those files.
thanks.

litemotiv 2011-12-18 11:44

Re: Lost SSH Root Access? Let me help you!
 
Quote:

Originally Posted by impact (Post 1139023)
I seem to recall reading here that root SSH access is disabled after the update. So either create the user "user", set his password with passwd and then try SSH-ing as user or enable root SSH (as detailed in the first post of this thread).

The default user is already called 'user', so i can't create that. Also changing the password for 'user' isn't allowed, issuing passwd returns 'The password for user cannot be changed'. :(

Edit: Ok i managed to change the user password through devel-su, i can ssh in now. Still not sure what the default password was supposed to be...

baptx 2011-12-27 16:02

Re: Lost SSH Root Access? Let me help you!
 
Thanks, detailed informations can be found here: http://sintonen.fi/n9_pr1.1_remote_root_ssh_login.txt
I was wondering if we can use SFTP via USB instead of Wifi. When we choose "SDK mode" after USB plug, there is an assigned IP in SDK connectivity tool...

LaLlamaQueLlama 2012-01-05 19:30

Re: Lost SSH Root Access? Let me help you!
 
Quote:

Originally Posted by F2thaK (Post 1117776)
Lost SSH Root Access? Let me help you!

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.

I dont get it, how should i do that if i canīt make myself root from terminal or ssh? All i get is a Permission denied

Edit:

Finally I was able to have root access by installing opensh

http://maemo.cloud-7.de/950/openmode..._PR1.1/opensh/

jalyst 2012-01-05 20:19

Re: Lost SSH Root Access? Let me help you!
 
You can make yourself root from the terminal* --> "root" then "rootme"
Then you can execute that command...

*or escalate privelages with SU....

afaq 2012-01-18 19:39

Re: Lost SSH Root Access? Let me help you!
 
my root password is not working! I set it yesterday and was accessing root a couple of hours ago and now it wont work. I have tried all possible passwords and I there is no way I have forgotten it or am typing it wrong.

Anyway to reset/recover the password?

vzp916 2012-01-27 20:30

Re: Lost SSH Root Access? Let me help you!
 
Quote:

Originally Posted by LaLlamaQueLlama (Post 1146278)
I dont get it, how should i do that if i canīt make myself root from terminal or ssh? All i get is a Permission denied

Edit:

Finally I was able to have root access by installing opensh

http://maemo.cloud-7.de/950/openmode..._PR1.1/opensh/

Are you on N9 or 950?

Also, do you have the Aegis-free kernel?

jalyst 2012-01-27 21:00

Re: Lost SSH Root Access? Let me help you!
 
Quote:

Originally Posted by vzp916 (Post 1156695)
Are you on N9 or 950?

Also, do you have the Aegis-free kernel?


AEGIS open-mode thread here
http://talk.maemo.org/showthread.php?t=81579


All times are GMT. The time now is 04:56.

vBulletin® Version 3.8.8