LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Unable to ssh into server via key (https://www.linuxquestions.org/questions/linux-server-73/unable-to-ssh-into-server-via-key-4175639928/)

sniper8752 10-07-2018 06:50 PM

Unable to ssh into server via key
 
I am trying to use sshfs, but it asks me for a passphrase (there is none), then a password. I followed this top rated answer: https://unix.stackexchange.com/quest...tication/55481 but it still seems to be prompting me for a password. When I try to ssh into the server with verbose on, this is what I get:
Code:

debug1: Authentications that can continue: publickey,password

michaelk 10-07-2018 07:30 PM

That is a normal debug message if you have both publickey and password authentication methods enabled.

Without knowing the specific steps you used to create the key it is difficult to provide help. It is also important that the directories and keys have the correct permissions set.

sniper8752 10-07-2018 08:00 PM

Quote:

Originally Posted by michaelk (Post 5912201)
Without knowing the specific steps you used to create the key it is difficult to provide help. It is also important that the directories and keys have the correct permissions set.

I copied it to the server.
I followed the linked guide to make sure everything has the right permissions.

michaelk 10-07-2018 08:15 PM

While the thread does contain some what a guide what exact steps did you follow? If your still prompted for a password then something is still not correct. There are more debug messages after the one you posted that might indicate a problem.

Turbocapitalist 10-08-2018 12:31 AM

Quote:

Originally Posted by sniper8752 (Post 5912206)
I followed the linked guide ...

There's no guide there, just some back-and-forth on stackexchange. Most guides are wrong or out of date on this topic anyway. The debug message you were looking for talks about which keys were tried, but if the error is on the server end the client won't say what's wrong, only that the key won't work.

On the client, set up a key pair and get the public key over to the server:

Code:

cd ~/.ssh/
ssh-keygen -t ed25519 -f server01.key.ed25519 -C "sniper8752 from the desktop"
ssh-copy-id -i server01.key.ed25519.pub server01.example.com

Then test the setup:

Code:

cd
ssh-add ~/.ssh/server01.key.ed25519
ssh  -i ~/.ssh/server01.key.ed25519 -l sniper8752 server01.example.com

If that works, then you can try sshfs. And if sshfs works, put something in your ~/.ssh/config file to make a shortcut for your key and remote user.


All times are GMT -5. The time now is 06:20 AM.