Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Jul 14, 2010 6:37 pm 
Offline
Newbie

Joined: Wed Jul 14, 2010 6:18 pm
Posts: 3
Hi all,

I opened a support ticket and it was suggested I bring it up here. Fresh eyes, and all that.

SSH'ing into my linode has been working fine for weeks, but since this morning SSH is failing with "Permission Denied (publickey)".
BTW, the security setup is a non-root public key authentication, using the user "ubuntu".

What I've Checked
Running SSH with -v switch gives:
Code:
debug1: Host 'mydomain.org' is known and matches the RSA host key.
debug1: Found key in /Users/daviddoran/.ssh/known_hosts:14
debug1: ssh_rsa_verify: signature correct

and
Code:
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/daviddoran/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Offering public key: /Users/daviddoran/.ssh/ddm-assembla-key
debug1: Authentications that can continue: publickey
debug1: Offering public key: /Users/daviddoran/.ssh/authorized_keys
debug1: Authentications that can continue: publickey
debug1: Offering public key: /Users/daviddoran/.ssh/tender-prod.pem
debug1: Authentications that can continue: publickey
debug1: Trying private key: /Users/daviddoran/.ssh/identity
debug1: Trying private key: /Users/daviddoran/.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey).

So the SSH client has verified we're dealing with the same host, and tries to use my SSH keys (id_rsa being the correct one).
Also, when I use the AJAX console and run `keysview`the public key line matches my id_rsa.pub exactly. Also, my id_rsa and id_rsa.pub files have modification times of a few months ago, as does the server's sshd_config.

My SSHD server config is:
Code:
Port 22
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 768
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
PermitRootLogin no
StrictModes yes
RSAAuthentication yes
RhostsRSAAuthentication no
PubkeyAuthentication yes
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no
PasswordAuthentication no
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#MaxStartups 10:30:60
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes
AllowGroups sshusers


Interestingly, though the `keysview` command in lish shows my public key in authorized_keys I can't find this actual file on the server--not sure if this means anything. Other than that I'm all out of ideas, I can't see any pointers to where something is changed or broken.

Any, and all, help appreciated -- thank you.


Top
   
 Post subject:
PostPosted: Wed Jul 14, 2010 6:41 pm 
Offline
Senior Member
User avatar

Joined: Tue Aug 17, 2004 11:37 pm
Posts: 262
Website: http://www.our-lan.com
WLM: nf@our-lan.com
Location: Brisbane, Australia
keysview on the server shows you keys that are authorized to log into lish.
Not to your server..

Remeber that LISH is your console, which runs on ssh on the linode server.

whereas you want to be ssh'ing to your linode.

_________________
ServerAdmin - www.our-lan.com
"Diplomacy is the art of saying nice doggy whilst looking for a really big stick"
"In my experiece, any attempt to make any system idiot proof will only challenge God to make a better idiot"


Top
   
 Post subject:
PostPosted: Wed Jul 14, 2010 7:00 pm 
Offline
Newbie

Joined: Wed Jul 14, 2010 6:18 pm
Posts: 3
That makes sense, now that you say it. I wasn't making the distinction between lish keys vs. standard console keys.

So, with that cleared up, I'll add a bit:

I've placed (my id_rsa.pub public key):
Code:
ssh-rsa AAAAB3NzaC1y................x0bs33RBfQ== myemail@gmail.com


In the following files:
Code:
/etc/ssh/authorized_keys
/etc/ssh/authorized_keys2
/root/.ssh/authorized_keys2
/root/.ssh/authorized_keys


I'm not 100% sure what the setup was when this _was_ working, since it was initially setup with a stackscript. But nothing has changed, to my knowledge.


Top
   
 Post subject:
PostPosted: Wed Jul 14, 2010 7:20 pm 
Offline
Senior Member
User avatar

Joined: Fri Oct 24, 2003 3:51 pm
Posts: 965
Location: Netherlands
The key needs to be in:
Code:
/home/username/.ssh/authorized_keys
or
Code:
/home/username/.ssh/authorized_keys2

/root/.ssh/authorized_keys is no good -- you've disallowed root logins

_________________
/ Peter


Top
   
 Post subject:
PostPosted: Wed Jul 14, 2010 7:33 pm 
Offline
Newbie

Joined: Wed Jul 14, 2010 6:18 pm
Posts: 3
Thank Jesus (nay, thank pclissold) that solved it.

In retrospect it seems blindingly obvious, that ~/ would be /home/ubuntu/ when ubuntu@ is trying to log in. I didn't think to use /home/ubuntu since there was no .ssh folder in there.

What I'm completely baffled about is where /home/ubuntu/.ssh went? It was non existent until I created it to place authorized_keys and authorized_keys2 in there a few minutes ago. But over night my setup broke, so presumably it existed previously...

(If anyone's interested, my day-to-day interactions with the server are via an automated git-pull script in /var/www, so I don't access my home folder directly.)

Thanks all.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group