maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   linux noob requires help with openssh (https://talk.maemo.org/showthread.php?t=36998)

Dave999 2009-12-17 23:30

Re: linux noob requires help with openssh
 
yes. sorry. application manager

but cant uninstall rootsh.

yes, also running put with same result.

thx anyway

kwotski 2009-12-18 01:01

Re: linux noob requires help with openssh
 
How are you changing the root password?

Edit: This is how it looks when I do it:
Quote:

N900:~# passwd
Changing password for root
Enter the new password (minimum of 5, maximum of 8 characters)
Please use a combination of upper and lower case letters and numbers.
New password:
Re-enter new password:
Password changed.
N900:~#
The # sign shows I'm root. If I don't see that then I'm not root.

I type "passwd" and enter, then follow the instructions.

It doesn't actually care if you enter numbers or upper case letters, btw, it's just giving you advice ;)

After I've done this, I can test it by typing "login" at the same place:

Quote:

N900:~# login
N900 login: root
Password:


BusyBox v1.10.2 (Debian 3:1.10.2.legal-1osso26+0m5) built-in shell (ash)
Enter 'help' for a list of built-in commands.

N900:~# exit
N900:~#
So I type "login" <enter> then at the "login" prompt, root, then at the next prompt, the password.

You could maybe try this procedure to see if you're changing the password properly.

I would do this, then if the password and login is ok, re-install the openssh client (yeah, I know ... ;) ) and then do:

N900:~# ssh 127.0.0.1

This will try and connect from the N900 to the N900 so we don't need to worry about network issues :)

It should look something like this:

Quote:

N900:~# ssh 127.0.0.1
The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established.
RSA key fingerprint is e9:79:ff:ef:ea:7d:3b:f7:36:ae:dd:a2:20:b1:01:d3.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '127.0.0.1' (RSA) to the list of known hosts.
root@127.0.0.1's password:


BusyBox v1.10.2 (Debian 3:1.10.2.legal-1osso26+0m5) built-in shell (ash)
Enter 'help' for a list of built-in commands.

N900:~# exit
Connection to 127.0.0.1 closed.
N900:~#
If that doesn't work, you could try SubCore's idea with the logs..

SubCore 2009-12-18 01:13

Re: linux noob requires help with openssh
 
if you're up to it, i have one more suggestion :)

by default, ssh doesn't log anything because the needed facility is missing, but with these steps you enable logging, which might help you track down the problem :

first, install sysklogd and klogd (all these steps require root access)
Code:

apt-get install sysklogd klogd
they are part of the official nokia repositories (downloads.maemo.nokia.com), so no need to worry.

next, you have to enable the AUTH facility:
edit /etc/syslog.conf and remove the # in the line containing auth.log
you can use vi:
Code:

vi /etc/syslog.conf
use the cursor until you're at the beginning of the mentioned line
press 'x' once to remove one character (the # sign)
it should look like this:
Code:

auth,authpriv.*                /var/log/auth.log
now save the file by typing this inside vi:
Code:

:x
for the changes to take effect, reboot the device

after the reboot, fire up xterminal again and watch the auth.log file:
Code:

tail -f /var/log/auth.log
you should see a few warning msgs about missing log files, that's to be expected.
with the -f option, tail keeps the file open and shows you changes as they happen. if you now try to connect again using putty or winscp, you should see something happening, hopefully including what's wrong. :)

a succesfull password authentication should look like this:
Code:

Dec 18 02:07:24 Nokia-N900-42-11 sshd[1817]: Accepted password for root from 172.16.66.14 port 48845 ssh2
if you need more info, you can increase the value of "LogLevel" in the file /etc/ssh/sshd_config to VERBOSE and restart sshd by
Code:

/etc/init.d/ssh restart

SubCore 2009-12-18 01:14

Re: linux noob requires help with openssh
 
Quote:

Originally Posted by kwotski (Post 432760)
How are you changing the root password?

if you have rootsh installed, open xterminal and type
Code:

sudo gainroot
passwd

you are now prompted for a new root password.

kwotski 2009-12-18 01:19

Re: linux noob requires help with openssh
 
Quote:

Originally Posted by SubCore (Post 432776)
if you have rootsh installed, open xterminal and type
Code:

sudo gainroot
passwd

you are now prompted for a new root password.

No kidding! ;)

I was asking Dave999 how *he* was doing it. He isn't the clearest communicator, unfortunately ;)

SubCore 2009-12-18 01:21

Re: linux noob requires help with openssh
 
Quote:

Originally Posted by kwotski (Post 432781)
No kidding! ;)

I was asking Dave999 how *he* was doing it. He isn't the clearest communicator, unfortunately ;)

lol sorry apparently i was still in answering mode *g*

time for bed

blubbi 2009-12-18 01:51

Re: linux noob requires help with openssh
 
Hey, why not use keys to authenticate...

a) Way more secure
b) No need to type password
c) Automation possible

Instead of listing the steps here how to create keys under Linux and use them, I'd rather link to http://linux.com tutorial which has some more useful information:
Using key-based authentication over SSH

When you are on windows... you are on your own... okay, I am not that mean :-) Just use Putty to generate a valid key:
Key-Based SSH Logins With PuTTY (I just tried it once with windows and a small note: PuTTY keys can not be used to authenticate Linux <-> Linux connections)

And just another hint for those who can't get a connection to there device when connected to the Internet via GPRS/UMTS.
Some providers do NAT, so the IP address the phone gets assigned is a none routeable address and thus you will not be able to connect to your device. Use some sort of VPN (OpenVPN) to get rid of that nasty problem.

Cheers
Bjoern

Dave999 2009-12-18 17:29

Re: linux noob requires help with openssh
 
thx all for your help
now
-------------------------------------------------------
Nokia-N900-42-11~#"login"
User:"root"
password:xxxxxxx

this works.
--------------------------------------------------------
Nokia-N900-42-11~#"ssh 127.0.0.1"
enter same password. working

blubbi 2009-12-18 18:06

Re: linux noob requires help with openssh
 
you can't login as "user" cause this account has no password by default (you would have to enable passwordless login)

be sure to do the following on the N900:

Quote:

sudo gainroot
passwd root
# [enter password two times]
/etc/init.d/sshd stop
ps -ef | grep ssh
# [if ther is still an sshd running, run the above command again, if it does not help, kill the process
# Now we start sshd in debug mode to see whats going on:
/usr/sbin/sshd -d -f /etc/ssh/sshd_config
Now login from remote with the following command:
Quote:

ssh root@${YOUR_DEVICE_IP}
# Enter your password
Now check what sshd is printing to the terminal.
If the login still does not work, post the entire output here.

I still would recommend to use key authentication instead of user/password verification.


Cheers
Bjoern

Dave999 2009-12-18 18:42

Re: linux noob requires help with openssh
 
Thx for all the help. will look into keys now.

have a few qustions if anyone have time. since im now log in with root

in sshd_config I want to set this flag to no: PermitRootLogin yes.

but do I need to create a new user or how can I log in after i changed this to "no"?

how do I create new user?

shall i change to another port than 22?

how do i do that?


All times are GMT. The time now is 09:11.

vBulletin® Version 3.8.8