key not found in authorized_keys

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I'm using ~/.ssh/authorized_keys to skip the password prompt.
I have two identical configurations, in one way, everything's OK (no pompt)
and in the other way, the password is prompted.

On both side, ssh version is
OpenSSH_3.8p1 Debian 1:3.8p1-3, SSH protocols 1.5/2.0, OpenSSL 0.9.7d 17 Mar 2004
(It happened also with previous versions)

Let's say I have the accounts user1@host1 and user2@host2.
Both sshd are listening to port 22, but to access host2 from host1,
I use a port port-forwarding natfirewall:2000 => host2:22.

host1 <---> natfirewall <---> host2

To connect from host2 to host1:
ssh user1@host1 (ok, no password)

to connect from host1 to host2 (host2 is not directly reachable)
ssh -p 2000 user2@natfirewall (password prompted, then everything ok).

authorized_keys files are generated correctly at both side.
(I can use ssh with no password prompt from user2@host2 to user2b@host2 with
the same technique, and from user1@host1 to user3@host3 with host1 and 3 on
the same network, no firewall between them)

sshd debug on host2 :
debug1: temporarily_use_uid: 1000/1000 (e=0/0)
debug1: trying public key file /home/user2/.ssh/authorized_keys
debug3: secure_filename: checking '/home/user2/.ssh'
debug3: secure_filename: checking '/home/user2'
debug3: secure_filename: terminating check at '/home/user2'
debug1: restore_uid: 0/0
debug2: key not found

I'm not sure to be clear enough. The trace above is generated with
'sshd -D -d -d -d -d' but it does not say why is the "key not found".

If someone can explain me, I'd be grateful,

Thanks to have read,


Re: key not found in authorized_keys

Quoted text here. Click to load it
Quoted text here. Click to load it

Does the client in this case have the private key corresponding to the
entries in authorized_keys?  No extra line breaks in the authorized_keys

Darren Tucker (dtucker at
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

Re: key not found in authorized_keys

Quoted text here. Click to load it

You are right !

I'm not fully aware of all ssh internal, but it seems that on the server
side, the key in ~/.ssh/authorized_keys is checked against the client side
~/.ssh/id_rsa, and I was using the content of ~/.ssh/
for the authorized_keys (on the client side, home directories are nfs

Many thanks for pointing me to this !

david - unaware

Site Timeline