You are not logged in.

#1 2015-03-07 17:12:13

joaocandre
Member
Registered: 2013-02-23
Posts: 166

[SOLVED] Can't copy new SSH public key to remote server

I'm trying to set up several access levels for my home server, so I've set up several users to chroot when logging in away from home. I've generated and copied an RSA key pair for my admin user, but when generating new RSA keys for other users I can't copy them to the remote server:

$ ssh-copy-id -i .ssh/id_rsa_web.pub web_user@[host_address]
/usr/bin/ssh-copy-id: INFO: attempting to log in with new key(s), to filter out any already installed 
/usr/bin/ssh-copy-id: INFO: 1 key(s)  remain to be installed -- if you are prompted now it is to install the new keys

Permission denied (publickey)

I can log in normally with my original ssh key. Why exactly can't I copy the new public key to the server?

Last edited by joaocandre (2015-03-13 15:30:50)

Offline

#2 2015-03-08 06:05:58

insequent
Member
Registered: 2012-07-10
Posts: 3

Re: [SOLVED] Can't copy new SSH public key to remote server

I can't say that I've used ssh-copy-id before, but it looks like your local host is being denied by the remote server (particularly its publickey). If you can log in using your "original ssh key", then leave that in place and use -i to specify id_rsa_web.pub.

I'm probably missing something though.

Offline

#3 2015-03-08 07:23:00

jocheem67
Member
Registered: 2009-11-09
Posts: 245

Re: [SOLVED] Can't copy new SSH public key to remote server

Did you try the " traditional method"  from the arch wiki, to copy ssh keys ? I'v always had more luck with that.

https://wiki.archlinux.org/index.php/SS … ote_server

Offline

#4 2015-03-13 15:30:27

joaocandre
Member
Registered: 2013-02-23
Posts: 166

Re: [SOLVED] Can't copy new SSH public key to remote server

I've found the problem - I had disabled password logins and obviously there was no key on the public sever. I temporarily reenabled passowrd login, then `ssh-copy-id` fell back to password logins and placed the public key on the server.

Not directly related to this, but since this was a chrooted user, I had to manually create the .ssh folder on the public server with the correct permissions (700, owned by web_user)

Offline

Board footer

Powered by FluxBB