Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    Problems using public key authentication in N900.

    Reply
    Page 1 of 3 | 1   2     3   | Next
    DojwqIO | # 1 | 2009-12-01, 19:30 | Report

    I installed openssh (server and client) and tried setting up public key authentication to login into the N900 from my Ubuntu machine, but it's not working.
    I generated the keys in Ubuntu with ssh-keygen, copied id_rsa.pub to /home/user/.ssh/authorized_keys in the N900 and it still asks for password when I try
    ssh user@N900_ip from the Ubuntu machine.
    I made sure the folder .ssh is chmod 700 in the N900 and the file /home/user/.ssh/authorized_keys is chmod 600.
    (Public authentication works using the N900 as client to login into Ubuntu.)
    I also cannot find the ssh logs in the N900 itself.
    I thought it would be /var/log/auth.log, as in Ubuntu, but it's not.
    Any suggestions?

    I apologize it this has been discussed in some other thread.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    fnordianslip | # 2 | 2009-12-01, 19:59 | Report

    Although I've not yet tried SSHing into my N900 yet, on my N800 I used to SSH in as root. If I didn't want privileges (which wasn't often), I'd su to user. Perhaps this will help?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    dantonic | # 3 | 2009-12-01, 20:07 | Report

    Originally Posted by DojwqIO View Post
    I installed openssh (server and client) and tried setting up public key authentication to login into the N900 from my Ubuntu machine, but it's not working.
    I generated the keys in Ubuntu with ssh-keygen, copied id_rsa.pub to /home/user/.ssh/authorized_keys in the N900 and it still asks for password when I try
    ssh user@N900_ip from the Ubuntu machine.
    I made sure the folder .ssh is chmod 700 in the N900 and the file /home/user/.ssh/authorized_keys is chmod 600.
    (Public authentication works using the N900 as client to login into Ubuntu.)
    I also cannot find the ssh logs in the N900 itself.
    I thought it would be /var/log/auth.log, as in Ubuntu, but it's not.
    Any suggestions?

    I apologize it this has been discussed in some other thread.
    I don't have an N900
    I assume just like any linux, and even the N800, just cd to .ssh,
    that is /home/user/.ssh
    open the file known_hosts
    and clear the contents.

    Do this on both ubuntu and the N900, and when you try to ssh next time it should ask if you want to trust the device and then automatically setup a key again.

    Again I don't own an N900 but this works for me on my N800 and ubuntu desktop

    ***EDIT***
    sorry idk how much linux experience you have:
    you may have to be root when opening the file to be able to save it.
    on N900 idk what editor is available. On N800 I just use leafpad, so from the command line I would type:
    sudo leafpad .ssh/known_hosts
    and this would open the file to edit in leafpad

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to dantonic For This Useful Post:
    DojwqIO

     
    DojwqIO | # 4 | 2009-12-01, 20:08 | Report

    Thanks,
    I can ssh in as root with password authentication. That is,
    I can ssh root@N900_ip and it asks for password and it works. Then as root, I can, as you suggest, su - user, and become "user". But I was trying to login using public keys just because I think it would be more secure in addition to having changed the default root password when I installed openssh server. The next step would be to disable root login.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    DojwqIO | # 5 | 2009-12-01, 20:19 | Report

    Originally Posted by dantonic View Post
    I don't have an N900
    I assume just like any linux, and even the N800, just cd to .ssh,
    that is /home/user/.ssh
    open the file known_hosts
    and clear the contents.

    Do this on both ubuntu and the N900, and when you try to ssh next time it should ask if you want to trust the device and then automatically setup a key again.

    Again I don't own an N900 but this works for me on my N800 and ubuntu desktop

    ***EDIT***
    sorry idk how much linux experience you have:
    you may have to be root when opening the file to be able to save it.
    on N900 idk what editor is available. On N800 I just use leafpad, so from the command line I would type:
    sudo leafpad .ssh/known_hosts
    and this would open the file to edit in leafpad
    Thanks, I will try clearing the known_hosts files. I only have the default vi editor in the N900 and I don't know how to use it very well yet.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    biatch0 | # 6 | 2009-12-02, 01:31 | Report

    Couple of things to try:

    - on embedded type devices (maybe the N900?), the /var directory is sometimes dumped into the /tmp directory... making the directory you're looking for /tmp/var/log
    - also are you confusing password with passphrase?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    j.s | # 7 | 2009-12-02, 04:18 | Report

    Mine works. How did you do the copy? Maybe the file
    got corrupted.

    Does md5sum give the same results on the n900 authorized_keys and the ubuntu id_rsa.pub give the same results?

    Try ssh -v
    in both directions. The resulting debug output will be
    voluminous and maybe obtuse, but any difference may
    be a clue.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    ruskie | # 8 | 2009-12-02, 06:36 | Report

    Have you tried: ssh -vvv that way you'll get a ton of info. If that fails. try setting that on the server and check what it stores in the log.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    adrianp | # 9 | 2009-12-02, 09:59 | Report

    Originally Posted by biatch0 View Post
    Couple of things to try:

    - on embedded type devices (maybe the N900?), the /var directory is sometimes dumped into the /tmp directory... making the directory you're looking for /tmp/var/log
    Really - wierd ? Try logging in then do a
    Code:
    find /var -mmin -5 -ls
    to find out which log file it uses; if that doesn't work try /tmp instead.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    archebyte | # 10 | 2009-12-02, 12:14 | Report

    Originally Posted by DojwqIO View Post
    I made sure the folder .ssh is chmod 700 in the N900 and the file /home/user/.ssh/authorized_keys is chmod 600.
    Are you logging into the N900 as root?

    In that case the authorized_keys file should be in /root/.ssh
    Code:
    Nokia-N900-42-11:~/.ssh# pwd
    /root/.ssh
    Nokia-N900-42-11:~/.ssh# ls -l
    -rw-------    1 root     root         1124 Nov 27 04:05 authorized_keys
    -rw-r--r--    1 root     root         1080 Nov 25 21:59 known_hosts
    Nokia-N900-42-11:~/.ssh#
    HTH

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Page 1 of 3 | 1   2     3   | Next
vBulletin® Version 3.8.8
Normal Logout