0

Not able to ssh localhost in ubuntu 14.04. Tried with ip also :

ashish@ashishk:~/chef-repo/.chef$ ssh ashish@localhost
Permission denied (publickey).
ashish@ashishk:~/chef-repo/.chef$ ssh ashish@172.19.24.36
Permission denied (publickey).
ashish@ashishk:~/chef-repo/.chef$ 
  • ashish@ashishk:~/chef-repo/.chef$ cat /etc/hosts 127.0.0.1 localhost 127.0.1.1 ashishk 172.19.24.36 ashishk.example.com ashishk 172.19.24.36 ashishk # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ashish@ashishk:~/chef-repo/.chef$ ping ashishk.example.com PING ashishk.example.com (172.19.24.36) 56(84) bytes of data. ^C--- ashishk.example.com ping statistics ---11 packets transmitted, 0 received, 100% packet loss, time 10079ms – Ashish Karpe Aug 26 '15 at 14:38
0

yes it's strange , this should be the kind of output: $ ssh eug3n10@localhost ssh: connect to host localhost port 22: Connection refused

if u have the port closed ( default ) of course.... check your /var/log/auth.log for anykind of analysis this is the start...

  • ashish@ashishk:~/chef-repo/.chef$ cat /etc/hosts 127.0.0.1 localhost 127.0.1.1 ashishk 172.19.24.36 ashishk.example.com ashishk 172.19.24.36 ashishk # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ashish@ashishk:~/chef-repo/.chef$ ping ashishk.example.com PING ashishk.example.com (172.19.24.36) 56(84) bytes of data. ^C--- ashishk.example.com ping statistics ---11 packets transmitted, 0 received, 100% packet loss, time 10079ms – Ashish Karpe Aug 26 '15 at 11:22
  • 1
    @AshishKarpe if you have additional information then please edit your question and add it there rather than as a comment – steeldriver Aug 26 '15 at 12:53
2

Most likely your computer does not have a private key to authenticate ssh and sshd config is set to use keys and password authentication is disabled, read https://help.ubuntu.com/community/SSH/OpenSSH/Keys for more info. you will need both private and public key to authenticate from local computer, if the firewall is set you may need to check that too. Check the port whether it is configured for default port 22 or some other port is used. the config file for sshd is /etc/ssh/sshd-config, you can check the keys in ~/.ssh

0

ok Ads is right , this definitely a "user-related error" the simplest thing to do is create another user with your same privileges and try again to SSH agin (priv-crypto key is to be automatically generated btw, not like in Cisco devices, it's strange what happens)

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.