用Vmware新装了ubuntu9.10虚拟机虚拟机之后,先配置虚拟机的网络。
host XP能ping通ubuntu, ubuntu能ping通局域网内除了host之外的其它所有PC机、能ping通网关。
但是在XP上ssh总是连不上ubuntu虚拟机。
google一下"ssh: connect to host localhost port 22: Connection refused",找到解决办法:
(1)http://ubuntuforums.org/showthread.php?t=662538
在虚拟机上试一下,能不能ssh自连,CMD:
ssh root@localhost
linux@ubuntu:~$ sudo /etc/init.d/ssh start
* Starting OpenBSD Secure Shell server sshd
Solution for “ssh: connect to host localhost port 22: Connection refused”
Hi friends,
Since three days, i had problem with my ssh connection. When i was tried to connect my laptop to others machine, I’m able to connect with them. But when i tried to connect, others machine to my laptop, I got this Error.
[student@mercury ~]$ ssh suresh@192.168.1.9
ssh: connect to host 192.168.1.9 port 22: Connection refused
Solution for this “port 22: Connection refused” :
First check if sshd is running by trying the command ‘$ pgrep sshd‘
on the host. If the output is empty, its very likely that sshd is not
running. Try ‘tail -f /var/log/messages’ on one terminal and do
a ‘$ /etc/init.d/sshd start‘ on another terminal. Then, check the
output that comes up on the previous terminal.
if PID comes, like 1702(any number), we conform the “sshd” is running.
Next, we have to flush the “iptables” by using the following command,
$ sudo iptables -F
That’s all. Now you can connect with anyone via ssh.
If again the same problem appear, Try ‘grep sshd /var/log/messages | tail‘ and
‘$ grep ssh /var/log/secure | tail‘ and check for any possible issues.