1

I am trying to ssh to a different system from my Ubuntu, but it got stuck after this log

root@akash:~# ssh -vvv root@192.168.2.219
OpenSSH_7.2p2 Ubuntu-4ubuntu2.2, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "192.168.2.219" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 192.168.2.219 [192.168.2.219] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.2

and after some time I got a connection time out. I generated the new ssh RSA key via ssh-keygen -t rsa on both the machines then, I copied my public key from id_rsa.pub to the file authorized_keys of the remote machine and vice-a-versa.

Now, one machine can login easily but the other one can't.

Can anyone tell me how to fix this?

  • Why are you running this with sudo? 1. You are already root so sudo is pointless. 2. You are logging in as root remotely, there's no reason to use sudo for the ssh command. Is your key your regular user's key? If so, root won't be able to use it. Are you sure the remote machine allows you to connect as root? It really, really shouldn't. What key did you copy? From where? To where? What directory? Please edit your question and clarify. – terdon Nov 29 '17 at 9:27
  • @terdon Is it Ok Now or Or something still missing? – Akash Sethi Nov 29 '17 at 9:45
  • No, we need to know what users are involved. You didn't answer any of my questions about root, you didn't explain what authorized_keys file you used (what directory, which machine). We need to know what was copied where. – terdon Nov 29 '17 at 10:02
  • We created a file authorized_keys under .ssh folder. Then, copied public key from id_rsa.pub file to authorized_keys file as I mentioned earlier. – Akash Sethi Nov 29 '17 at 10:09
  • You haven't told us which .ssh folder. /root/.ssh? /home/akash/.ssh? On which machine? Local or remote? And please edit your question to add this information. And, for the third time, explain why you are doing all this as root. – terdon Nov 29 '17 at 10:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.