LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (http://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   ssh: connect to host localhost port 22: Connection refused (http://www.linuxquestions.org/questions/linux-desktop-74/ssh-connect-to-host-localhost-port-22-connection-refused-935331/)

hussainv1 03-19-2012 01:34 PM

ssh: connect to host localhost port 22: Connection refused
 
Hello folks,

I'm installing Apache Hadoop on Ubuntu 11.10 following this tutorial http://www.michael-noll.com/tutorial...-node-cluster/

But when i run this command "ssh localhost" in the terminal, i get the following message ssh: connect to host localhost port 22: Connection refused

I tried all the possible solutions in the article, but not much success.

hduser@hussain:~$ ssh -vvv localhost
OpenSSH_5.8p1 Debian-7ubuntu1, OpenSSL 1.0.0e 6 Sep 2011
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to localhost [127.0.0.1] port 22.
debug1: connect to address 127.0.0.1 port 22: Connection refused
ssh: connect to host localhost port 22: Connection refused



Please help me as i'm stuck with this here.

Thank you,

Warm Regards,
Hussain

repo 03-19-2012 01:36 PM

Verify your firewall.
make sure the ssh daemon is running.

kind regards

hussainv1 03-19-2012 01:44 PM

Quote:

Originally Posted by repo (Post 4630794)
Verify your firewall.
make sure the ssh daemon is running.

kind regards

Hi, thanx for ur reply. I'm not much familiar with linux environment.
Please tell me how to check firewell? should it be enabled or disabled?

I ran the below command to check for deamon process...is this right?

hduser@hussain:~$ ps aux | grep ssh
hussain 1319 0.0 0.0 3856 168 ? Ss Mar19 0:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session /usr/bin/gnome-session --session=ubuntu
hduser 24755 0.0 0.0 4200 752 pts/1 S+ 00:11 0:00 grep --color=auto ssh


Warm Regards,
Hussain

repo 03-19-2012 01:48 PM

You need to start or install the shh daemon.
Code:

sudo apt-get install openssh-server
Kind regards

hussainv1 03-19-2012 01:53 PM

Quote:

Originally Posted by repo (Post 4630798)
You need to start or install the shh daemon.
Code:

sudo apt-get install openssh-server
Kind regards

Thanks a lot buddy, it just worked great. You made my day :cool:

Warm Regards,
Hussain

Skaperen 03-21-2012 02:21 PM

I recommend changing your port number. If you leave port 22 exposed to the internet, you will (eventually) see hundreds to thousands of connection attempts each day as various kiddies around the world will be trying to play password guessing games. You may have a very secure unguessable password, but the attempts WILL flood your logs, preventing you from easily spotting things you should actually be concerned about.

Once changed, you can then use the -p option on ssh, or the -P option on scp, to specify the port to connect to. Or better yet, code it into the ~/.ssh/config file.

I'm not telling what port number I'm using. But it does not have "22" in it.

Nathesh 05-30-2013 05:30 PM

[QUOTE=Skaperen;4632845]I recommend changing your port number. If you leave port 22 exposed to the internet, you will (eventually) see hundreds to thousands of connection attempts each day as various kiddies around the world will be trying to play password guessing games. You may have a very secure unguessable password, but the attempts WILL flood your logs, preventing you from easily spotting things you should actually be concerned about.

Once changed, you can then use the -p option on ssh, or the -P option on scp, to specify the port to connect to. Or better yet, code it into the ~/.ssh/config file.



I had a question about this. I am sshing to a localhost.{ssh localhost} Does this mean I am connecting to my own computer using a ssh? Then why would I be worried about someone accessing my computer?
This is for creating HDFS. What I wanted to created virtual machines, which would act as namenode and data another for data node? How would I proceed with this?

Any help would be great!


All times are GMT -5. The time now is 11:38 AM.