Solved

Linux rsh problem

Posted on 2013-01-27
14
2,456 Views
Last Modified: 2013-02-11
Whenever I try to use rsh I get:
poll: protocol failure in circuit setup

I configured it according this link: http://people.redhat.com/kzak/docs/rsh-rlogin-howto.html

And made sure that the iptables service is off.

The system is RedHat 4 AS.
How do I fix it?

Thanks,
Tal
0
Comment
Question by:questil
  • 7
  • 7
14 Comments
 

Author Comment

by:questil
ID: 38824031
A new entry is added to /var/log/messages when I try to rsh:

rshd[17511]: can't get stderr port: Permission denied
0
 
LVL 77

Expert Comment

by:arnold
ID: 38824109
Rsh is an insecure protocol and is often disabled in inetd.conf or xinetd depending on the system, you can achieve the same thing using using ssh.

http://www.mkssoftware.com/docs/man1/rsh.1.asp look whether the user remuser is in hosts.equiv
0
 

Author Comment

by:questil
ID: 38824149
It must be rsh, required by DB2.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 77

Expert Comment

by:arnold
ID: 38824182
The user used in the rsh must be included in hosts.equiv local and remote.

The error you might be getting from the local system when rsh attempts to bind to the local stderr.
0
 

Author Comment

by:questil
ID: 38824186
cat /etc/hosts.equiv
+
0
 
LVL 77

Expert Comment

by:arnold
ID: 38824207
On the remote to which rsh connects, host.equiv
Source_host source_user

Ssh into the remote server as a separate session, then use strace on xinetd process strace -f -p <PID>
Then see where the deny comes in when the rsh session is attempted.
0
 

Author Comment

by:questil
ID: 38824216
It's all on the same host, the problem is to rsh to localhost.
0
 
LVL 77

Expert Comment

by:arnold
ID: 38824245
Try localhost localuser in hosts.equiv
Iptables are not enforced/applied on localhost.
0
 

Author Comment

by:questil
ID: 38824268
cat /etc/hosts.equiv
+ +

/usr/bin/rsh localhost date
poll: protocol failure in circuit setup

0
 
LVL 77

Expert Comment

by:arnold
ID: 38824394
Are the pus signs supposed to replace the explicit notation of
localhost localusername
?
Use strace on xinetd process to see what is going on on the initiation of the rsh session and the causes for its failure.

http://www.novell.com/support/kb/doc.php?id=3077223
0
 

Author Comment

by:questil
ID: 38825826
According to hosts.equiv man page the plus signs will allow any user from any machine to connect.

I run strace on the pid of xinetd and this is the output:

Process 27496 attached - interrupt to quit
select(11, [3 5 6 8 9 10], NULL, NULL, NULL) = 1 (in [9])
accept(9, {sa_family=AF_INET, sin_port=htons(1023), sin_addr=inet_addr("127.0.0.1")}, [16]) = 11
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x2a95d7def0) = 30315
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=803, ...}) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=803, ...}) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=803, ...}) = 0
sendto(7, "<86>Jan 28 09:29:38 xinetd[27496"..., 72, MSG_NOSIGNAL, NULL, 0) = 72
close(11)                               = 0
select(11, [3 5 6 8 9 10], NULL, NULL, NULL) = 1 (in [5])
accept(5, {sa_family=AF_INET, sin_port=htons(38165), sin_addr=inet_addr("127.0.0.1")}, [16]) = 11
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x2a95d7def0) = 30316
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=803, ...}) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=803, ...}) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=803, ...}) = 0
sendto(7, "<86>Jan 28 09:29:38 xinetd[27496"..., 71, MSG_NOSIGNAL, NULL, 0) = 71
close(11)                               = 0
select(11, [3 5 6 8 9 10], NULL, NULL, NULL) = ? ERESTARTNOHAND (To be restarted)
--- SIGCHLD (Child exited) @ 0 (0) ---
write(4, "\21", 1)                      = 1
rt_sigreturn(0x4)                       = -1 EINTR (Interrupted system call)
select(11, [3 5 6 8 9 10], NULL, NULL, NULL) = 1 (in [3])
ioctl(3, FIONREAD, [1])                 = 0
read(3, "\21", 1)                       = 1
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WNOHANG, NULL) = 30316
close(4294967295)                       = -1 EBADF (Bad file descriptor)
wait4(-1, 0x7fbffffafc, WNOHANG, NULL)  = 0
select(11, [3 5 6 8 9 10], NULL, NULL, NULL) = ? ERESTARTNOHAND (To be restarted)
--- SIGCHLD (Child exited) @ 0 (0) ---
write(4, "\21", 1)                      = 1
rt_sigreturn(0x4)                       = -1 EINTR (Interrupted system call)
select(11, [3 5 6 8 9 10], NULL, NULL, NULL) = 1 (in [3])
ioctl(3, FIONREAD, [1])                 = 0
read(3, "\21", 1)                       = 1
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], WNOHANG, NULL) = 30315
close(4294967295)                       = -1 EBADF (Bad file descriptor)
wait4(-1, 0x7fbffffafc, WNOHANG, NULL)  = -1 ECHILD (No child processes)
select(11, [3 5 6 8 9 10], NULL, NULL, NULL <unfinished ...>
Process 27496 detached


The link you provided is for remote firewalled system (it's not the case) and the system hangs for a long time before it return this error. in my case it return it immediately.
0
 
LVL 77

Expert Comment

by:arnold
ID: 38826564
Could you post the complete command,? Try instead of using localhost, use the IP on the system.
0
 

Author Comment

by:questil
ID: 38826785
It's the same output with localhost, hostname or IP address:

rsh localhost date
connect to address 127.0.0.1: Connection refused
Trying krb4 rsh...
connect to address 127.0.0.1: Connection refused
trying normal rsh (/usr/bin/rsh)
poll: protocol failure in circuit setup


For root it works! if I change /etc/xinetd.d/rsh to user = root instead of this user I have no problem.

Any idea what could it be?
0
 
LVL 77

Accepted Solution

by:
arnold earned 500 total points
ID: 38827018
The service has to run as root that is the issue with security.
You should explicitly limit using hosts.equiv the machine and user that can connect using rsh, rlogin, etc.
0

Featured Post

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need BIOS update Linux for MSI X99A motherboard. 4 53
number in printf 13 32
Why  my code (program) build with old compiler? 11 75
php56-php-mcrypt for rhel7 php56 1 46
Hello EE, Today we will learn how to send all your network traffic through Tor which is useful to get around censorship and being tracked all together to a certain degree. This article assumes you will be using Linux, have a minimal knowledge of …
BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (https://kb.isc.org/article/AA-01272), affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question