1833219 Members
3141 Online
110051 Solutions
New Discussion

checking port status

 
SOLVED
Go to solution
Chern Jian Leaw
Regular Advisor

checking port status

Hi,

I would like to check the status of a port for a particular service. What is the command to check if the port is opened or closed?

I've tried doing a rcp from 1 host machine to another. If I were to invoke rcp or rsync from the source machine it produces the error:

rcmd2: socket : The file access permissions do not allow the specified action.

If rcp or rsync was invoked from the destination machine, it does not produce this error.

What is the port number for rcp? Do I need to explicitly add the service rcp or rsync with its port number into the /etc/services file? I tried adding those services into the /etc/services file, but that did not work.

Could some one please help me out?

Thanks.
3 REPLIES 3
Michael Tully
Honored Contributor
Solution

Re: checking port status

If I understand this correctly, you need to use the remote shell from system A to system B.
Remove the comment from this line in '/etc/inetd.conf' file

shell stream tcp nowait root /usr/lbin/remshd remshd

Once the file is saved, run 'inetd -c' to re-read the configuration.
Anyone for a Mutiny ?
Chern Jian Leaw
Regular Advisor

Re: checking port status

Michael,

I've manage to do an rsh/rcp/ between host A to host B and vice versa .

I would like to check if the port controlling the rcp, rsh service is up or not. Could you tell me how do I do that ?

I have the line which you told to have it's comment removed untouched. It has never once been commented.

Thanks.
CJ
V. V. Ravi Kumar_1
Respected Contributor

Re: checking port status

hi,

use lsof (list open files) to know the status of a port.
ex: lsof -i tcp
to do rcp u don't need add service in /etc/services.
on the machine 2 (to which u r doing rcp)
in the home directory of user u should have a file called .rhosts. in this file u should have ip or name of the machine 1 (from which u r doing rcp). the same user must exist in the machine 1. this .rhosts is user specific.

to have system wide access u should put the entry of the machine 1 in /etc/hosts.eqiv

regds
ravi
Never Say No