* About to connect() to remote-server-host5 port 22 (#0) Host:~# curl -vv 'telnet://remote-server-host5:22' Some web servers or application servers usually have wget or curl as it is integral part for some local shell scripts doing various operation needed for proper services functioning or simply to test locally a local or remote listener services, if that's the case we can use curl to connect and get output of a remote service simulating a normal telnet connection like this: Ssh: connect to host 192.168.1.200 port 23: Connection timed outīut what if Linux server you have tow work on is so paranoid that you even the ssh client is absent? Well you can use anything else that is capable of doing a connectivity to remote port such as wget or curl.
Here is another example on how to test remote host whether a certain service such as DNS (bind) or telnetd is enabled and listening on remote local network IP with /home ]# ssh 192.168.1.200 -p 53 -v -oConnectTimeout=5ĭebug1: Connecting to 192.168.1.200 port 53.ĭebug1: connect to address 192.168.1.200 port 53: Connection timed out Ssh_exchange_identification: Connection closed by remote host That342200231s an error.ĭebug1: ssh_exchange_identification: Your client has issued a malformed or illegal request. Ssh: connect to host port 80: Cannot assign requested ssh -p 80 -vĭebug1: identity file /root/.ssh/id_rsa type 0ĭebug1: identity file /root/.ssh/id_rsa-cert type -1ĭebug1: identity file /root/.ssh/id_dsa type -1ĭebug1: identity file /root/.ssh/id_dsa-cert type -1ĭebug1: identity file /root/.ssh/id_ecdsa type -1ĭebug1: identity file /root/.ssh/id_ecdsa-cert type -1ĭebug1: identity file /root/.ssh/id_ed25519 type -1ĭebug1: identity file /root/.ssh/id_ed25519-cert type -1ĭebug1: identity file /root/.ssh/id_xmss type -1ĭebug1: identity file /root/.ssh/id_xmss-cert type -1ĭebug1: Local version string SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u2ĭebug1: ssh_exchange_identification: HTTP/1.0 400 Bad Requestĭebug1: ssh_exchange_identification: Content-Type: text/html charset=UTF-8ĭebug1: ssh_exchange_identification: Referrer-Policy: no-referrerĭebug1: ssh_exchange_identification: Content-Length: 1555ĭebug1: ssh_exchange_identification: Date: Wed, 14:13:25 GMTĭebug1: ssh_exchange_identification: Error 400 (Bad Request)!!1ĭebug1: ssh_exchange_identification: *ĭebug1: ssh_exchange_identification: 400. Ssh: connect to host port 80: Cannot assign requested ssh -p 80 -v -oConnectTimeout=5ĭebug1: connect to address 142.250.184.142 port 80: Connection timed outĭebug1: connect to address 2a00:1450:4017:80c::200e port 80: Cannot assign requested address Ssh_exchange_identification: Connection closed by remote ssh -p 80 -v -oConnectTimeout=3ĭebug1: connect to address 2a00:1450:4017:80b::200e port 80: Cannot assign requested address Ssh: connect to host port 80: Cannot assign requested ssh -p 80 Ssh: connect to host port 23: Cannot assign requested ssh -oConnectTimeout=3 -v -p 80ĭebug1: Connecting to port 80.ĭebug1: connect to address 172.217.169.206 port 80: Connection timed outĭebug1: connect to address 2a00:1450:4017:807::200e port 80: Cannot assign requested address OpenSSH_7.9p1 Debian-10+deb10u2, OpenSSL 1.1.1g ĭebug1: Connecting to port 23.ĭebug1: connect to address 172.217.169.206 port 23: Connection timed outĭebug1: connect to address 2a00:1450:4017:80b::200e port 23: Cannot assign requested address
Google / Yahoo search /home ]# ssh -oConnectTimeout=3 -v -p 23
As often this is useful, if you don't have access to the CISCO / Juniper or other (networ) / firewall equipment which is setting the boundaries and security port restrictions between networks and servers.īelow is example on how to use ssh client to test port connectivity to lets say the Internet, i.e. If you're lucky to have the ssh onboard you can use telnet in same manner as netcat or the swiss army knife (nmap) network mapper tool to test whether remote service TCP / port is opened or not. I do have experience with such environments myself and thus it is pretty daunting stuff so in best case you can use something like a simple ssh client if you're lucky and the CentOS / Redhat / Suse Linux whatever distro has openssh-client package installed. If you work on PCI high security environment servers in isolated local networks where each package installed on the Linux / Unix system is of importance it is pretty common that some basic stuff are not there in most cases it is considered a security hole to even have a simple telnet installed on the system.