2
hadoopmaster@dhruvhadoop1-HP-Compaq-dc5800-Small-Form-Factor:~/.ssh$ ssh-copy-id -i ~/.ssh/id_rsa.pub slave-1

/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed


/usr/bin/ssh-copy-id: ERROR: ssh: connect to host slave-1 port 22: Connection refused
TheWanderer
  • 19,395
  • 12
  • 50
  • 65
dhruv bhardwaj
  • 181
  • 2
  • 2
  • 4

2 Answers2

3

I'd generally take "connection refused" to mean that the target server isn't listening on port 22.

What's the output of netstat -an|grep 22 when run on slave-1?

You should get something like:

$ netstat -an|grep 22
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN

Probably you need to install/start the ssh server on slave-1

ssta
  • 763
1

I have the same problem. sometime the error is simple, ssh is not installed. the openssh-client should be installed on your local machine, and openssh-server should be installed on the remote computer. However, you can install both openssh-client and openssh-server on both machines.

Use this :

sudo apt-get update
sudo apt-get install openssh-server openssh-client

Visit https://ubuntuforums.org/showthread.php?t=1702992

edwinksl
  • 23,789