+3 votes
495 views
SSH does not connect. Error: Permission denied (publickey, gssapi-keyex, gssapi-with-mic)

in Linux / Unix by (551k points)
recategorized by | 495 views

1 Answer

+4 votes
Best answer

After making some updates on the server, when trying to access by SSH through the WinSCP, we see an unsuccessful authentication message; that prevents us from accessing the console normally. After having checked different parameters through the console and verify that port 22 is listening, we went to verify the SSH configuration file and check its parameters to be able to solve it.

The error message is as follows:

"Authentication log (use session log for more details): 
Using the username" root ".

Failed authentication! "

connection error ssh 1

In this case we have solved the problem by changing a parameter of the configuration file. SSH is listening, but since the sshd_config file is not configured correctly, it does not allow you to connect via SSH. Try accessing the configuration file  / etc / ssh / sshd_config , and check having the parameter as " PasswordAuthentication yes ".

To do this, follow these steps:

1. Access the console of your provider panel, and type the following command line:

# nano / etc / ssh / sshd_config

3. Search the line " PasswordAuthentication no " and change it to " PasswordAuthentication yes ". If the line with " #" was commented , you must uncomment it.

error connection ssh 2

4.- If you are editing with nano, save the changes with the "CTRL + O" key and press "ENTER", to exit nano press "CTRL + X" and press "ENTER". Once you have left the editor, you must restart the server by typing in console "reboot" + "ENTER"

#reboot

5.- When restarting the server try to access again by SSH, in this case the incident could be resolved and allowed us to access without problems.


by (3.5m points)
selected by

Related questions

+4 votes
1 answer
asked May 25, 2019 in Linux / Unix by backtothefuture (551k points) | 422 views
+4 votes
1 answer
asked Jan 17, 2023 in Windows11 by backtothefuture (551k points) | 64 views
+3 votes
1 answer
asked Jun 25, 2020 in Mac by backtothefuture (551k points) | 7k views
+3 votes
1 answer
+5 votes
1 answer
Sponsored articles cost $40 per post. You can contact us via Feedback

Most popular questions within the last 30 days

  1. Cell phone location by number: How easy it is to do it in Latam
10,634 questions
10,766 answers
510 comments
3 users