using keys for ssh connection
I am trying to create public/private keys to connect to my ssh server. I use puttygen/putty, and when I connect, it tells me that the "server refused our key". I ran the following commands:
Code:
# chmod 700 ~/.ssh Code:
AuthorizedKeysFile %h/.ssh/authorized_keys EDIT: By the way, I followed this tutorial: https://www.digitalocean.com/communi...nnect-to-a-vps |
what's in /var/log/secure or /var/log/auth.log about it? (you also should mention what distro and version you are running)
|
Raspbian. It's for my Raspberry Pi.
Code:
User ftpuser from computer not allowed because not listed in AllowUsers |
Anybody have any ideas?
|
Well you could take out the allowusers directive and see if the lockdown is causing it and it's a syntax issue.
|
I still get the error that the server refused the key.
|
ftpuser is in /etc/passwd in the server? (grep ftpuser /etc/passwd)
|
yes; /var/www:/bin/bash
For sshd_config: RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile %h/.ssh/authorized_keys |
Are you able to connect to the server with putty using a password?
|
yes
|
You did run these commands as root ?
Code:
# chmod 700 ~/.ssh and permissions need to be set as ftpuser |
so .ssh should be in /var/www? why is it in the user's home directory?
I did run these, but will run them again. Should the user owner be ftpuser, as well as the group owner? |
Quote:
.ssh should be in user dir according to sshd_config (%h/.ssh) Quote:
Quote:
or more simple, as root : "id ftpuser" |
What if I want to allow other users to login?
|
Eventually users can login to ftpuser account if they have their public keys appended to /var/www/.ssh/authorized_keys file, then login as: ssh ftpuser@server
But it has some security concerns for sure. Anyway if you tell what specifically your plan is from the start, you'll get more productive answers I think |
All times are GMT -5. The time now is 04:17 AM. |