You are not logged in.

#1 2022-10-01 13:27:35

an4rki_
Member
Registered: 2022-08-16
Posts: 50

[SOLVED] OpenSSH ERROR: Permission denied ( publickey )

Hey Archers!
I am trying to disable clear text passwords for better security for my home server. I have made the following changes to /etc/ssh/sshd_config file on the server. I have not touched any configs on the client side.

Changes Made
PermitRootLogin - changed to no
PasswordAuthentication - uncommented and changed from yes to no

Here's the config file.

Here's the log file.

The ~/.ssh directory has 700 permission and the public key in that directory has 644 permission while the private key has 600.

Edit: When I comment out PasswordAuthentication and then try to ssh from a different terminal, I am not getting the enter passphrase prompt but instead I am getting the enter password prompt.

an4rki_

Last edited by an4rki_ (2022-10-01 14:50:24)


"A computer is like air conditioning - it becomes useless when you open Windows." - Linus Torvalds
Arch + DWM

Offline

#2 2022-10-01 14:13:30

seth
Member
Registered: 2012-09-03
Posts: 51,318

Re: [SOLVED] OpenSSH ERROR: Permission denied ( publickey )

The ~/.ssh directory has 700 permission and the public key in that directory has 644 permission while the private key has 600.

Client or server? The private key has no business being on the server and the public key needs to be in .ssh/authorized_keysauthorized_keys

See https://wiki.archlinux.org/title/OpenSSH#Checklist and esp. #5

Online

#3 2022-10-01 14:25:00

an4rki_
Member
Registered: 2022-08-16
Posts: 50

Re: [SOLVED] OpenSSH ERROR: Permission denied ( publickey )

Hey, thanks for the quick reply @seth.

seth wrote:

Client or server? The private key has no business being on the server and the public key needs to be in .ssh/authorized_keysauthorized_keys

I am talking about the file permissions on the client machine and not the server. And yes, I checked the contents of .ssh/authorized_keys on the server and it does contain my public key.


"A computer is like air conditioning - it becomes useless when you open Windows." - Linus Torvalds
Arch + DWM

Offline

#4 2022-10-01 14:33:31

seth
Member
Registered: 2012-09-03
Posts: 51,318

Re: [SOLVED] OpenSSH ERROR: Permission denied ( publickey )

Then raise the verbosity of ssh on client and server to see why either might not be happy w/ your key (could be incompatible algorithms)

Online

#5 2022-10-01 14:48:57

an4rki_
Member
Registered: 2022-08-16
Posts: 50

Re: [SOLVED] OpenSSH ERROR: Permission denied ( publickey )

seth wrote:

Then raise the verbosity of ssh on client

I had saved the key as g0roth_id_ed25519.pub while generating the key pair under the ~/.ssh directory but apparently it was not able to find it. Here's the output after setting the verbose flag. I kept the default name i.e. id_ed25519.pub and it worked.

Last edited by an4rki_ (2022-10-01 14:49:25)


"A computer is like air conditioning - it becomes useless when you open Windows." - Linus Torvalds
Arch + DWM

Offline

#6 2022-10-01 15:03:57

seth
Member
Registered: 2012-09-03
Posts: 51,318

Online

Board footer

Powered by FluxBB