I have always connected to my server with ssh (ssh user#ip_address) and had no problems, but suddenly I get this error message:
ssh: connect to host 178.79.131.53 port 22: Connection timed out
I ping the server and i'ts fine
I also disabled ufw thinking that the firewall was the problem but still the same error
I can connect to other servers
Also when I do nmap 178.79.131.53 -p 22 still says I get this message:
Nmap scan report for ServerName (xxx.xx.xxx.xx)
Host is up (0.062s latency).
PORT STATE SERVICE
22/tcp filtered ssh
Nmap done: 1 IP address (1 host up) scanned in 0.70 seconds
Note: It'a Linode server
Related
I'm desperate for help. I have spent almost a day now trying to figure out why cURL is suddently throwing curl: (7) Failed to connect to magento.localhost port 80: Connection refused on local vhosts after I restarted macOS High Sierra.
My setup worked without problems before – ping still works, opening the domain in the browser also works as expected. What is going on??
ping magento.localhost
PING magento.localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.034 ms
host magento.localhost
magento.localhost has address 127.0.0.1
magento.localhost has IPv6 address ::1
scutil -r magento.localhost
Reachable
apachectl configtest
Syntax OK
netstat -a | grep http | grep LISTEN
tcp46 0 0 *.http . LISTEN
curl -v magento.localhost
Rebuilt URL to: magento.localhost/
Trying 127.0.0.1...
TCP_NODELAY set
Connection failed
connect to 127.0.0.1 port 80 failed: Connection refused
Failed to connect to magento.localhost port 80: Connection refused
Closing connection 0
curl: (7) Failed to connect to magento.localhost port 80: Connection refused
I have tried every suggestions I found! - thank you so much for your help!
Nic3500, you saved my life! After your comment I found out that my vhosts produced different results than localhost itself.
telnet magento.localhost 80
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection
refused telnet: Unable to connect to remote host
telnet localhost 80
Trying ::1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.
So I have changed /usr/local/etc/dnsmasq.conf to address=/localhost/::1 and
/private/etc/resolver/localhost to nameserver ::1 and now cURL is working alongside with everything else.
Thank you very much!
I was setting up a firewall with UFW in Ubuntu server, I skipped the step sudo ufw allow ssh and instead run the command sudo ufw enable. Rebooted the VPS but now when I try to connect using ssh, I get the following error ssh: connect to host {IP Address} port 22: Operation timed out.
I am using Google Cloud Compute Infrastructure and I'm not understanding details in this article https://cloud.google.com/compute/docs/ssh-in-browser#ssherror
Is there a way I can rollback?
You can login to your instance using the serial console. After logging in you should run the command: sudo ufw allow ssh, for allowing ssh access to your instance.
See Interacting with the Serial Console for more information
I'm trying to run a ssh SOCKS server on Windows 7 (listening on port 12345).
Here's the output I get on Cygwin:
$ ssh -v -D 12345 localhost
OpenSSH_6.8p1, OpenSSL 1.0.2c 12 Jun 2015
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to localhost [::1] port 22.
debug1: connect to address ::1 port 22: Connection refused
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
Why is it trying to connect to localhost:22?
Looks like it's trying to reach sshd running on localhost.
I thought the ssh client was enough to set up a local SOCKS server. If it isn't, why do I need sshd running?
From https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding:
"Dynamic port forwarding turns your SSH client into a SOCKS proxy server"
To explain why you need a (remote) ssh server, ssh can do three (or four) kinds of forwarding; quoting the man page:
-L Specifies that the given port on the local (client) host is to be
forwarded to the given host and port on the remote side. This
works by allocating a socket to listen to port on the local side,
optionally bound to the specified bind_address. Whenever a con-
nection is made to this port, the connection is forwarded over
the secure channel, and a connection is made to host port
hostport from the remote machine. [...]
-R Specifies that the given port on the remote (server) host is to
be forwarded to the given host and port on the local side. This
works by allocating a socket to listen to port on the remote
side, and whenever a connection is made to this port, the connec-
tion is forwarded over the secure channel, and a connection is
made to host port hostport from the local machine. [...]
-D Specifies a local ``dynamic'' application-level port forwarding.
This works by allocating a socket to listen to port on the local
side, optionally bound to the specified bind_address. Whenever a
connection is made to this port, the connection is forwarded over
the secure channel, and the application protocol is then used to
determine where to connect to from the remote machine. Currently
the SOCKS4 and SOCKS5 protocols are supported, and ssh will act
as a SOCKS server. [...]
-X and -Y enable forwarding for X11. This is a small but convenient variation of -R.
Note that in all cases the data is forwarded over the ssh tunnel, from the local machine to the ssh server or the reverse, and (therefore) the ssh tunnel must exist for the data to be forwarded over. The only difference between -L and -D is that -D uses SOCKS4/5 on the local end to specify where the remote end connects to.
If you want a SOCKS proxy that connects directly from the proxy to the destination, not over an ssh tunnel, you need a plain SOCKS proxy, not ssh+sshd.
Your trying to connect without a port. So port 22 is used. Once that connection is open then SSH will set up the socks proxy on the port you specified (12345)
You need to connect to a valid SSH server. You specify the port with the -p flag
I have an .ssh/config:
Host host01 host01.in.mynet
User costello
HostName 1.2.3.4
Port 22222
Which is working fine with plain ssh:
ssh host01
costello#host01 ~ »
But fabric is not using that config:
$ fab deploy:host=host01
[host01] Executing task 'deploy'
Fatal error: Low level socket error connecting to host host01 on port 22: Connection refused (tried 1 time)
Underlying exception:
Connection refused
Aborting.
Why is fabric not using the ssh's configuration? I would really like to avoid duplicating the configuration for fabric or, even worse, change the ssh port of my server.
I am running a java application on a remote server that opens port 7462 for a telnet connection to issue simple commands. I have established a VPN connection (using openvpn) between my local machine and the remote server, but cannot telnet from my local machine to port 7462. The IP address of my vpn server is 10.8.0.1. I am also running postfix on my remote server and am able to telnet to port 25 without any issues. The following commands yield the below results:
On my local machine:
$ telnet 10.8.0.1 25
Trying 10.8.0.1...
Connected to 10.8.0.1.
Escape character is '^]'.
220 xxxxx.com ESMTP Postfix (Debian/GNU)
quit
221 2.0.0 Bye
Connection closed by foreign host.
$ telnet 10.8.0.1 7462
Trying 10.8.0.1...
Connected to 10.8.0.1.
Escape character is '^]'.
Connection closed by foreign host.
$
On the remote server:
$ netstat -plnt | grep -P "7462|25"
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN -
tcp 0 0 10.8.0.1:7462 0.0.0.0:* LISTEN 6463/java
tcp6 0 0 :::25 :::* LISTEN -
$ telnet 10.8.0.1 7462
Trying 10.8.0.1...
Connected to 10.8.0.1.
Escape character is '^]'.
exit
OK Goodbye
Connection closed by foreign host.
An iptables -L command on both the local and remote machine show that I have no firewall rules established and I have not specifically configured any routes.
I can't figure out why I can connect to the remote server's port 25 from my local machine, but not port 7462. From the remote server though I can connect to port 7462 using the 10.8.0.1 IP address. I'd be happy to provide any additional information and thanks in advance for you help
-Nathan
I figured out my problem. The application was limiting the IP addresses that could connect on the 7462 port and it was a configuration item that needed to be set (default was just localhost). I feel a little silly for such a simple answer, but thanks for the suggestions!
I figured out my problem. The application was limiting the IP addresses that could connect on the 7462 port and it was an (obscure) configuration item that needed to be set (default was just localhost). I feel a little silly for such a simple answer, but thanks for the suggestions!