LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-28-2011, 03:14 PM   #1
hector00
LQ Newbie
 
Registered: Aug 2011
Posts: 8

Rep: Reputation: Disabled
SSH problems on remote desptop


Hi Networkers,

Having some problems with logging into SSH my local desktop with the default 'ssh -v localhost' command. This is after creating both RSA and DSA keys. I must admit, that things have gotten a bit murky over the time I've been trying to get this working on my local machine. Verbose output is as follows:


[QUOTE]lewis@lewis:/etc/ssh$ ssh -v localhost
OpenSSH_5.8p1 Debian-1ubuntu3, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to localhost [::1] port 22.
debug1: Connection established.
debug1: identity file /home/lewis/.ssh/id_rsa type -1
debug1: identity file /home/lewis/.ssh/id_rsa-cert type -1
debug1: identity file /home/lewis/.ssh/id_dsa type -1
debug1: identity file /home/lewis/.ssh/id_dsa-cert type -1
debug1: identity file /home/lewis/.ssh/id_ecdsa type -1
debug1: identity file /home/lewis/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.8p1 Debian-1ubuntu3
debug1: match: OpenSSH_5.8p1 Debian-1ubuntu3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.8p1 Debian-1ubuntu3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: RSA 12:99:d6:26:d3:08:e6:5f:03:1d:bb:de:2b:34:e8:2b
debug1: Host 'localhost' is known and matches the RSA host key.
debug1: Found key in /home/lewis/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
Ubuntu 11.04
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering DSA public key: /home/lewis/.ssh/id_dsa
debug1: Authentications that can continue: publickey
debug1: Offering RSA public key: /home/lewis/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/lewis/.ssh/id_ecdsa
debug1: No more authentication methods to try.
Permission denied (publickey).

So I understand that it is failing due to public key authentication. I am well and truly stumped as the numerous threads and tutorials have confused me more than anything else.
Any suggestions about what I should be copying/editing/adding would be very much appreciated.

Thank you

Hector
 
Old 08-28-2011, 03:18 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
Well the usual issue preventing public key authentication when it is otherwise correctly set up, is that the ~/.ssh directory permission and the authorized_keys file permissions are incorrect, and chould be 700 and 600 respectively.
 
Old 08-28-2011, 03:39 PM   #3
hector00
LQ Newbie
 
Registered: Aug 2011
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thank you for your swift reply.

I changed permissions on ~/.ssh folder to 700 however I do not have a authorized_keys file inside the directory. Instead I have a 'known_hosts' file, therefore the directory structure is as follows

lewis@lewis:/etc/ssh$ ls -l ~/.ssh/
total 20
-rw------- 1 lewis root 668 2011-08-28 20:13 id_dsa
-rw-r--r-- 1 lewis root 601 2011-08-28 20:13 id_dsa.pub
-rw------- 1 lewis root 1675 2011-08-28 20:13 id_rsa
-rw-r--r-- 1 lewis root 393 2011-08-28 20:13 id_rsa.pub
-rw-r--r-- 1 lewis root 443 2011-08-28 18:56 known_hosts

So naturally I get:

lewis@lewis:/etc/ssh$ chmod 600 ~/.ssh/authorized_keys
chmod: cannot access `/home/lewis/.ssh/authorized_keys': No such file or directory

The known_hosts file contains an ssh-rsa key value preceded by |1|

Thanks
 
Old 08-28-2011, 03:43 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
If you've no authorized_keys file, how many guides did you look at?? That file is on the remote system, containing a copy of the private key.
 
Old 08-31-2011, 05:53 AM   #5
jv2112
Member
 
Registered: Jan 2009
Location: New England
Distribution: Arch Linux
Posts: 719

Rep: Reputation: 103Reputation: 103
Lightbulb



Why did you generate two keys ? I would think it is causing conflicts. Especially since your issue started after generating both.

I would nuke all the files and start over generating one key. If that does not work I would look at the permissions again.
 
Old 08-31-2011, 05:54 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
Quote:
Originally Posted by jv2112 View Post


Why did you generate two keys ? I would think it is causing conflicts. Especially since your issue started after generating both.

I would nuke all the files and start over generating one key. If that does not work I would look at the permissions again.
No, they can't conflict. it tries one then the other.
 
Old 09-01-2011, 05:18 AM   #7
jv2112
Member
 
Registered: Jan 2009
Location: New England
Distribution: Arch Linux
Posts: 719

Rep: Reputation: 103Reputation: 103
acid_kewpie thanks for the clarification.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problems accessing a remote server using ssh or sftp lloowen Linux - Networking 22 05-05-2010 09:35 PM
Problems with remote connection bet. Linux and Win using SSH and Putty cucolin@ Ubuntu 4 10-02-2006 11:53 PM
problems with X-apps when executed on remote host via ssh numerous Linux - Software 1 01-17-2005 08:08 PM
Remote X with Cygwin, ssh problems kuronai Linux - Networking 3 06-03-2004 05:18 AM
problems getting remote ssh/X connection working fabs Linux - Newbie 6 03-01-2004 11:24 PM


All times are GMT -5. The time now is 02:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration