Attach process with port 2222

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Attach process with port 2222
# 1  
Old 04-26-2017
Attach process with port 2222

Hi Team,

is there any way, I can start any process for e.g. run a shell script (infinite loop) and attach it to port 2222?

I am trying to create a scenario where an application will start running at port 2222 and I will telnet the same to confirm, application port is listening.
So, requirement is, running a demo process at port 2222 and doing further checks.

Thanks
Vivek
# 2  
Old 04-26-2017
You can use nc (or netcat) to listen to a particular port:-
Code:
 
 nc -l 2222

From nc manual page:-
Code:
     -l      Used to specify that nc should listen for an incoming connection rather than initiate a connection to a remote host.

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. IP Networking

Get process id and port from the socket

Hello, Please help me in getting the process id and the port number from the socket netstat -Aan|grep -i closed f100050010b133b8 tcp 0 0 *.* *.* CLOSED f1000500119b53b8 tcp4 0 0 *.* *.* ... (3 Replies)
Discussion started by: Vishal_dba
3 Replies

2. UNIX for Dummies Questions & Answers

Check port 2222 is open on a remote host

I am able to connect to a remote host using the legacy IP and port 2222. Today the remote has a new IP I am unable to connect. How to check if the remote host is blocking or if its my server is unable to connect. Err Msg : telnet: Unable to connect to remote host: Connection refused Err... (5 Replies)
Discussion started by: ITDev01
5 Replies

3. IP Networking

Tcp ip port open but no such process (merged: Release A Port)

i want to kill a tcp connection by killing its pid with netstat -an i got the tcp ip connection on port 5914 but when i type ps -a or ps-e there is not such process running on port 5914 is it possible that because i do not log on with proper user account i can not see that process running? (30 Replies)
Discussion started by: alinamadchian
30 Replies

4. AIX

Process running on which port

I would like to know, how to find that particular process is running on which port other than /etc/services as this file shows well known ports information Double post, continued here. If you want answers for different OS, post in a general section instead. If you want your other post moved... (0 Replies)
Discussion started by: amity
0 Replies

5. Programming

dbx - attach to process, break when crash

Hey everyone, I have a process that is crashing, and I'd like to have some way to see where it crashes. Is this possible? (2 Replies)
Discussion started by: ctote
2 Replies

6. UNIX for Advanced & Expert Users

Which port is used by which process ?

Hi all, I work in three platforms SOLARIS,HPUX,AIX. My requirement is to find the user id which is using a particular port. So I tried searching commands which will help me to know which port is used by which process. According to the posts over here lsof makes life easy in this case. But I... (4 Replies)
Discussion started by: vikasrout
4 Replies

7. UNIX for Advanced & Expert Users

How to attach an xterm to a process/thread ?

Hi folks, I would like to know how to hook up an xterm to another process. Here is a high level view of what I am looking for 1. Main program starts 2. It creates an new xterm window 3. It then forks a second process & passes the xterm handle to it 4. The second process uses the second... (4 Replies)
Discussion started by: RipClaw
4 Replies

8. UNIX for Advanced & Expert Users

attach process from another ssh session

Hi, I was logged in on a server, by ssh, with a vim open, when the battery of my laptop got empty. When I return to the server by ssh, I can see my previous ssh session still open, and the vim process running (ttyp0). Is there a way to attach that vim to my new session (ttyp4)? Here's part... (2 Replies)
Discussion started by: raphinou
2 Replies

9. AIX

Process ID using IP Port

Is there a way in AIX to determine which process is connected to a particular IP port? I know about the lsof command, but for various reasons I can't install it on the machine I want to use it on. Is there a way other than using this command? (1 Reply)
Discussion started by: dgiaimo
1 Replies

10. Solaris

Which process is on which port....

Is there a way in Solaris to find which process is using which port? (3 Replies)
Discussion started by: Kraas
3 Replies
Login or Register to Ask a Question