I'm getting this error: permission denied (public key)

Why do I get this error when doing ssh login on my root user permission denied (public key) ? But when I try ssh login on my another user it works.

Then I tried changing ssh-keygen and now I can't ssh login on my both users. How can I solve this problem?

Thanks!

11 Replies

Not a lot of info being provided.

Have you tried using ssh -v to get verbose info to see where it thinks it is failing?

EDIT BTW.. when I first read this, I though you were able to login via root but not via a normal user.

I tried, it shows

Connecting to IP address port 22

connection established

Then it checks the blacklist file, identity files on .ssh..atlast it shows permission denied(private key) and I really can't find where the problem is from. Could you guide me?

UPDATE:

I suppose here the problem is from

debug1: Authentications that can continue: publickey

debug1: Next authentication method: publickey

debug1: Offering RSA public key: /home/user/.ssh/id_rsa

debug1: Authentications that can continue: publickey

debug1: Trying private key: /home/user/.ssh/id_dsa

debug1: read PEM private key done: type RSA

debug1: Authentications that can continue: publickey

debug1: Trying private key: /home/user/.ssh/id_ecdsa

debug1: No more authentication methods to try.

Permission denied (publickey).

@rkumarnirmal:

I tried, it shows

Connecting to IP address port 22

connection established

Then it checks the blacklist file, identity files on .ssh and I really can't find where the problem is from. Could you guide me?
Based on the info you are providing… not really since I can't see what you are seeing.

The -v flag generates a lot of info which contains info about each step the process is taking along with the results. Something is failing, but without the output???? can't even guess other than you might have permissions of the files setup incorrectly.

If you are uncomfortable posting that kind of info, you should find someone that can look at it for you privately.

Please check my previous reply :)

It is common practice to deny root logins using any authentication method – some distros do this by default. If you really want to allow this, check your sshd config file for a line that reads 'PermitRootLogin no' and change accordingly.

Accidentally I changed the .ssh/idrsa file which is why creating the problem. I can't access the root login because I disabled 'PermitRootLogin' and the worst one is now I can't even login through my another user because of changing the keygen. So how can I upload idrsa file to server as FTP rejects the connection too.

Please someone help me. I'm a newbie in linux administration :(

@pclissold:

It is common practice to deny root logins using any authentication method – some distros do this by default. If you really want to allow this, check your sshd config file for a line that reads 'PermitRootLogin no' and change accordingly.

sshd in server? I can't able to login to the linode server. so how can I change it?

Use your remote access via the linode console and you can get into the box and make the changes you need to make.

If sshd is hosed, you can still access your system via Lish or the (somewhat buggy) AJAX console.

I had to use LISH for this same reason. I had ccidently changed the group of the ssh folder for my user and had root login disabled as well (which is a good thing).

I went into the remote access tab and decided to try the ajax console and while it was a little slow, it worked great. I was able to log in and fix my little mess up with almost no effort.

Gotta love Linode at a time like that.

I struggled to login to my linode on weblish only to realize that it can be achieved by simply typing "root" or "my_user".

This allowed me to paste my public key to a file in .ssh. After logging out of weblish (just typing "logout"), I was able to access my server through my laptop's terminal.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct