Solved

Linux rsh problem

Posted on 2013-01-27
14
2,562 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 78

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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
LVL 78

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 78

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 78

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 78

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 78

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 78

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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
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 …
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.:
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

688 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