Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot ssh to localhost [closed]

Tags:

ubuntu

I am trying to see if ssh is properly configured on Ubuntu 11.04:

  ashish@ubuntu:~$ ssh localhost   ssh: connect to host localhost port 22: Connection refused   ashish@ubuntu:~$ 

What do I do from here?

like image 603
Ashish Agarwal Avatar asked Jun 25 '11 11:06

Ashish Agarwal


People also ask

Why is SSH connection closed?

SSH Port is ClosedIf the port is closed, the server refuses the connection. By default, SSH uses port 22. If you haven't made any configuration changes to the port, you can check if the server is listening for incoming requests. Find port 22 in the output and check whether its STATE is set to LISTEN.

Can you SSH into localhost?

Open the terminal on the server machine. You can either search for “terminal” or press CTRL + ALT + T on your keyboard. Type in ssh localhost and hit enter.


Video Answer


2 Answers

Try:

sudo apt-get install openssh-server 

It's most likely that the ssh server is not installed as only the client is installed by default.

like image 135
Dan D. Avatar answered Sep 20 '22 23:09

Dan D.


Make sure the SSHD is running, looks like it is not.

Try

service sshd start 

I am not familiar with ubuntu, but this should work.

like image 31
ChrisBint Avatar answered Sep 23 '22 23:09

ChrisBint