/usr/bin/ssh-copy-id: ERROR: ssh: connect to host localhost port 22: Connection refused
问题原因:ubuntu默认没有安装openssh-server,想要看是否安装,则执行ps -e | grep ssh
,如果是这样
说明没有安装openssh-server,则需要安装它
sudo apt-get install openssh-server
/usr/bin/ssh-copy-id: ERROR: ssh: connect to host localhost port 22: Connection refused
ps -e | grep ssh
,如果是这样sudo apt-get install openssh-server