csselo
By:
csselo

SSH permission Denied

April 12, 2018 94 views
Security Ubuntu 16.04

Hi

2 weeks ago I format my pc to ubuntu 17.10.Then I try to log in my server but it refuses.

  • I create rsa keyin my pc. and put it from droplet panel first but it refuses again (permission denied) then tried DO ssh setting (how to use ssh key) , it refuses again
  • I changed ssh_config, add password authentication pubkey auth, rsa auth, it refuses permision denied
  • I remove .ssh folder from root and user in droplet, it refuses again

output
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 2 key(s) remain to be installed -- if you are prompted now it is to install the new keys
Permission denied (publickey).

or

debug1: Offering RSA public key: /home/selo/.ssh/idrsa
debug3: send
pubkeytest
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug1: Offering RSA public key: /home/selo/.ssh/id
rsa
debug3: sendpubkeytest
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/selo/.ssh/iddsa
debug3: no such identity: /home/selo/.ssh/id
dsa: No such file or directory
debug1: Trying private key: /home/selo/.ssh/idecdsa
debug3: no such identity: /home/selo/.ssh/id
ecdsa: No such file or directory
debug1: Trying private key: /home/selo/.ssh/ided25519
debug3: no such identity: /home/selo/.ssh/id
ed25519: No such file or directory
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).

what must I do?

note: I read all question about ssh in do

thanks

3 Answers

I create rsa keyin my pc. and put it from droplet panel first but it refuses again (permission denied) then tried DO ssh setting (how to use ssh key) , it refuses again

Adding your ssh key to your account makes it available on the droplet creation page so it can be inserted into new droplets when they are created. It is not applied to your existing droplets.

I changed ssh_config, add password authentication pubkey auth, rsa auth, it refuses permision denied

If you were attempting to switch to password authentication you will also want to make sure that AllowRootLogin is set to true unless you are using a different user.

I remove .ssh folder from root and user in droplet, it refuses again

This effectively deletes all reference on your droplet to your keys and will completely prevent any login with a key since there is no key to match it up against.

Once you've created your private/public keypair on your local machine this tutorial can be used to help you place it properly on your droplet. The relevant section is "How To Copy a Public Key to your Server".

SSH, or secure shell, is the most common way of administering remote Linux servers. Although the daemon allows password-based authentication, exposing a password-protected account to the network can open up your server to brute-force attacks. In this guide, we demonstrate how to configure your server with SSH keys, which is the recommended authentication method. These are much more difficult for attackers to work around, giving you a more secure login mechanism.

can u write ur do and local ssh_config pls?

DO host from droplet console root and user

chmod 700 .ssh
chmod 600 .ssh/authorized_keys

copy ur pub with wget
cat publickey > .ssh/authorized_key (root and user)

solved

Have another answer? Share your knowledge.