I've installed Ubuntu 12.04.1 LTS on it with the LAMP stack.
I can ping it but when I try to connect to it the server can't be found.
When I try to connect with WinSCP I get the error Network error: connection refused.
I've installed the openssh-server and openssh-client packages but still can not connect.
1 Answer
It sounds like a firewall issue to me. Is this machine behind a physical firewall on a different network or on the same LAN? If it is on a different network, check both the gateway firewall and the host firewall (iptables) and make sure that port 22 is allowed.
To do this, follow these instructions:
Login as the
rootuser.Open
/etc/sysconfig/iptablesfile, enter:# vi /etc/sysconfig/iptablesFind line that read as follows:
COMMITTo open port 22 (
ssh), enter (beforeCOMMITline):-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPTSave and close the file. Restart the firewall:
# /etc/init.d/iptables restartNext check to make sure the service is listening.
Try issuing the command:
netstat -vatn | grep :22and see if port 22 is listening.You could also try:
netstat -vatn | grep ssh
This will take care of the host-based firewall, but if there is a network-based firewall between you and the machine you are trying to remote into then you will have to consult that specific device's instructions for allowing connections to port 22 into the network.
5