how to find out if a port is available on a remote machine?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users how to find out if a port is available on a remote machine?
# 1  
Old 08-03-2009
how to find out if a port is available on a remote machine?

hi,

I can ping into another unix machine, but I cannot seem to access a certain application. I think it might be because I am now allowed to connect to the port (because of firewall configuration).

How can I find out if I have access to a port on another machine?

thanks
# 2  
Old 08-03-2009
A simple first step is to attempt to telnet to the specific port
Code:
telnet <server> <port>

# 3  
Old 08-03-2009
using telnet, try connecting to that port: telnet ip_address port_num
if the port is open, you'll see something like:
Code:
yogeshs@yogesh-laptop:/tmp$ telnet 10.2.28.51 22
Trying 10.2.28.51...
Connected to 10.2.28.51.
Escape character is '^]'.
SSH-1.99-OpenSSH_3.9p1

now press ctrl+] and hit enter. when you get telnet> prompt, type quit and press enter.

if the port is closed, you'll see something like:
Code:
yogeshs@yogesh-laptop:/tmp$ telnet 10.2.28.51 222
Trying 10.2.28.51...
telnet: Unable to connect to remote host: Connection refused
yogeshs@yogesh-laptop:/tmp$

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Bash script, find the next closed (not in use) port from some port range.

hi, i would like to create a bash script that check which port in my Linux server are closed (not in use) from a specific range, port range (3000-3010). the print output need to be only 1 port, and it will be nice if the output will be saved as a variable or in same file. my code is: ... (2 Replies)
Discussion started by: yossi
2 Replies

2. Shell Programming and Scripting

Rsync from remote machine via ssh and sync by uisng find by modified time

Hi I have a requirement to rsync from remote to local machine via ssh and sync files that are changed in last n hours. pgrep to check if no other sync is running pgrep -f rsync.*/opt > /dev/null || rsync --bwlimit=10000 -avz --delete root@X.X.X.X:/var/source/ /opt/dest/ >> /home/log 2>&1... (0 Replies)
Discussion started by: robo
0 Replies

3. Solaris

How to find port number wwn of particular port on dual port HBA,?

please find the below o/p for your reference bash-3.00# fcinfo hba-port HBA Port WWN: 21000024ff295a34 OS Device Name: /dev/cfg/c2 Manufacturer: QLogic Corp. Model: 375-3356-02 Firmware Version: 05.03.02 FCode/BIOS Version: BIOS: 2.02; fcode: 2.01;... (3 Replies)
Discussion started by: sb200
3 Replies

4. Shell Programming and Scripting

Help with fetching the data from remote machine from my jumpbox(local machine)

Team, Presently i am running a script from my local box(i.e jumpbox) to all the remote machines.Basically fetching basic queries like pwd,mkdir,touch etc and i am able to successfully fetch it from my local machine.But when i want to check certain database related queries like the dbstat... (20 Replies)
Discussion started by: whizkidash
20 Replies

5. Red Hat

iptables applied in local machine, can't ssh remote machine after chain changed to DROP

I want to SSH to 192.168.1.15 Server from my machine, my ip was 192.168.1.99 Source Destination was UP, with IP 192.168.1.15. This is LAN Network there are 30 Machine's Connected to the network and working fine, I'm Playing around the local machine's because I need to apply the same rules in... (2 Replies)
Discussion started by: babinlonston
2 Replies

6. UNIX for Advanced & Expert Users

FTP While transfering files to local machine to remote machine

Hi Am using unix Ksh Am getting the problem while transferring zero size files through the script . When i transfer zero size files from local machine to remote machine manually i can able to do it . My question its beause of zero size files am not able to transfer through script ? or its... (2 Replies)
Discussion started by: Venkatesh1
2 Replies

7. IP Networking

How to find if remote n/w port is listening on HP-UX from the binary

Hi, I have an executable running on HP-UX, from this executable I need to findout if the portnumber. lets say 7890,7891, 7892 are listening on the remote server running on HP-UX. I can do it by creating socket, connect etc. But is there any other way of doing it using "system()" function or... (3 Replies)
Discussion started by: einsteinBrain
3 Replies

8. Red Hat

To find the LATEST file from a dir on REMOTE machine and SCP to local machine?

Hi All, URGENT - Please help me form a scipt for this: I need the LATEST file from a dir on REMOTE machine to be SCP'd to a dir on local machine. (and I need to execute this from local server) I know that the below cmd is used to find the LATEST file from a dir. But this command is not... (3 Replies)
Discussion started by: me_ub
3 Replies

9. IP Networking

To find switch port of machine running under VMware

I would like to find a switch port( of a VLAN of CISCO switch) of a machine which is acutally running under VMware. Now I only know about IP & MAC address of a machine which running under VMware and I do not know about the real machine where VMware is installed. Is there any possibility? (2 Replies)
Discussion started by: Tlogine
2 Replies

10. UNIX for Advanced & Expert Users

accessing unix machine through com port

sirs, iam using cygwin software (linux environment on windows xp). I have connected unix machine to COM port to which i can access through hyper terminal. Can i access the unix machine from the cygwin (linux)...if so how it can be done. please give ur valuable suggestions................. (0 Replies)
Discussion started by: manikumar
0 Replies
Login or Register to Ask a Question