If I run rsh, it works, but prints some strange “Connection refused” messages at the beginning:
$ rsh localhost pwd
connect to address 127.0.0.1 port 544: Connection refused
Trying krb4 rsh...
connect to address 127.0.0.1 port 544: Connection refused
trying normal rsh (/usr/bin/rsh)
/home/service
But if I run rsh under strace, it doesn't connect to the server at all:
$ strace -c rsh localhost ulimit -n
connect to address 127.0.0.1 port 544: Connection refused
Trying krb4 rsh...
connect to address 127.0.0.1 port 544: Connection refused
trying normal rsh (/usr/bin/rsh)
rcmd: socket: Permission denied
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
28.39 0.000113 2 58 read
27.64 0.000110 16 7 write
16.83 0.000067 1 47 open
15.33 0.000061 2 27 munmap
11.81 0.000047 1 80 mmap
0.00 0.000000 0 58 close
0.00 0.000000 0 1 stat
0.00 0.000000 0 45 fstat
..........................................
..........................................
..........................................
Here is an extract from strace rsh localhost ulimit -n:
connect(3, {sa_family=AF_INET, sin_port=htons(544), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 ECONNREFUSED (Connection refused)
write(2, "Connection refused\n", 19) = 19
connect(3, {sa_family=AF_INET, sin_port=htons(544), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 ECONNREFUSED (Connection refused)
write(2, "Connection refused\n", 19) = 19
Questions
- What is causing
port 544: Connection refused? - Why does it show the error
rcmd: socket: Permission denied? It should show some integer value (the output ofulimit -non the remote machine).