Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
0
votes
1
answers
2415
views
RSH giving Connectin Refused error on RHEL
I am trying to do `rsh` on one of my VM but getting connection refused error. I have checked `/etc/hosts` and `/etc/resolv.conf` both have proper hostname, IP and domain.
I am trying to do
rsh
on one of my VM but getting connection refused error.
I have checked /etc/hosts
and /etc/resolv.conf
both have proper hostname, IP and domain.
linux user
(13 rep)
Oct 12, 2015, 05:04 PM
• Last activity: May 9, 2025, 09:06 AM
1
votes
3
answers
6855
views
rsh runs perfectly in normal user but not in root, very strange, why?
When I run command, `rsh localhost pwd` as a root It shows below output. 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 When I run the same command...
When I run command,
rsh localhost pwd
as a root
It shows below output.
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
When I run the same command from normal user named service
. Then it shows below output.
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
Why this behavior happening?
devsda
(437 rep)
Mar 16, 2013, 09:45 PM
• Last activity: Apr 3, 2025, 02:54 PM
2
votes
3
answers
7836
views
What is "rsh" and how to disable it?
I've never heard of the word `rsh` before, but I received a checklist from a security advisor that we have to "disable `rsh`". Can someone please tell me what `rsh` and how to disable it, please? We are using RHEL 5.5 and 5.6.
I've never heard of the word
rsh
before, but I received a checklist from a security advisor that we have to "disable rsh
".
Can someone please tell me what rsh
and how to disable it, please?
We are using RHEL 5.5 and 5.6.
OmiPenguin
(4398 rep)
Jan 12, 2013, 10:13 AM
• Last activity: Mar 11, 2024, 03:20 AM
0
votes
1
answers
65
views
How to run netscape navigator with rsh and DISPLAY?
I want to launch Netscape Navigator The 6000 port on my host is open the host is added using xhost+ host + 192.168.0.33 If I did rlogin 192.168.0.33 and then export DISPLAY=192.168.0.2:0 navigator Works fine. But I want to run directly on host I have tried rsh 192.168.0.33 DISPLAY=192.168.0.2:0 navi...
I want to launch Netscape Navigator
The 6000 port on my host is open
the host is added using xhost+
host + 192.168.0.33
If I did
rlogin 192.168.0.33
and then
export DISPLAY=192.168.0.2:0
navigator
Works fine.
But I want to run directly on host I have tried
rsh 192.168.0.33 DISPLAY=192.168.0.2:0 navigator
and
DISPLAY=192.168.0.2:0 192.168.0.33 navigator
and
export DISPLAY=192.168.0.2:0
rsh 192.168.0.33 /usr/bin/navigator
and
rsh 192.168.0.33 "export DISPLAY=192.168.0.2:0 ; /usr/bin/navigator"
But don't work
Why?
FAQ
Q: Why not ssh which is simpler and more secure?
A: This is an old host, ssh2 is not supported
Q: Why use a very old browser?
A: Is for turn on an old Bare-metal ibm server which use very old ssl protocols (ssl2, rc4 and other weak tools) for remote manage via ASMI , the modern browser has ssl3 and tls 1.1 disabled so cannot open a webpage "protected" using ssl2
Q: Why don't upgrade ASMI?
A: This server is discontinued since 10-15 years
elbarna
(13690 rep)
Nov 12, 2023, 02:25 AM
• Last activity: Nov 17, 2023, 09:47 PM
0
votes
0
answers
285
views
SSH jump proxy to access RSH-only endpoint
The setup: only a single server in the group is acessible via SSH. Others are accessible from the former via RSH only. So when I want to execut a command on other servers, I do this: ``` $ ssh asd10 rsh asd7 hostname ASD7 ``` Is it possible to combine this into `ProxyCommand` in the [classical SSH j...
The setup: only a single server in the group is acessible via SSH. Others are accessible from the former via RSH only.
So when I want to execut a command on other servers, I do this:
$ ssh asd10 rsh asd7 hostname
ASD7
Is it possible to combine this into ProxyCommand
in the classical SSH jumphost way?
> A configuration like this will allow you to proxy through HOST A.
>
> > $ cat .ssh/config
>
> Host host-a
> User your_username
> Hostname 10.0.0.5
>
> Host host_b
> User your_username
> Hostname 192.168.0.1
> Port 22
> ProxyCommand ssh -q -W %h:%p host-a
>
>
> Now if you want to connect to your HOST B, all you have to type is ssh host_b
... so I could run:
$ ssh asd7 hostname
ASD7
?
**[Supplemented]**
If I go straightly like @cas asked:
$ ssh -t -o ProxyCommand='ssh asd10 rsh %h' asd7 hostname
tcgetattr: Invalid argument
ioctl TIOCGETP: Invalid argument
ioctl TIOCLGET: Invalid argument
ioctl TIOCGETC: Invalid argument
ioctl TIOCGLTC: Invalid argument
ioctl TIOCGETP: Invalid argument
ioctl TIOCLGET: Invalid argument
ioctl TIOCSLTC: Invalid argument
ioctl TIOCSETC: Invalid argument
ioctl TIOCSETN 3: Invalid argument
ioctl TIOCLSET: Invalid argument
Killed by signal 2.
... it stays in a loop until I press Ctrl-C.
It probably waits for the input and then generates no output. I haven't used a working shell session in parallel to check if the former actually spawns any new processes.
saulius2
(151 rep)
Oct 28, 2019, 08:35 AM
• Last activity: May 8, 2023, 10:37 AM
1
votes
0
answers
1766
views
how to install rsh/rlogin on RHEL 9
I need to install rsh/rlogin services on a RHEL9 host. It looks like these services were removed from the distribution and also from EPEL. I know all the reasons not to install these, but I need to anyway. Is there a way I can do it?
I need to install rsh/rlogin services on a RHEL9 host. It looks like these services were removed from the distribution and also from EPEL.
I know all the reasons not to install these, but I need to anyway. Is there a way I can do it?
mikem
(885 rep)
Nov 28, 2022, 06:48 PM
1
votes
0
answers
251
views
After restarting xinetd service, rsh shows "poll: protocol failure in circuit setup"
I have searched a lot in various forums and most indicate that the solution is to open ports in the firewall or restart the `xinetd` service. Although that may be the solution in some cases, I think the problem is another and is still pending solution. I have Red Hat 6, `iptables` service is off, an...
I have searched a lot in various forums and most indicate that the solution is to open ports in the firewall or restart the
xinetd
service. Although that may be the solution in some cases, I think the problem is another and is still pending solution.
I have Red Hat 6, iptables
service is off, and I have not modified the executables rshd
/rsh
.
Initially, when I start the system, rsh works fine:
# rsh localhost pwd
/root
If I simply restart the service "xinetd", I get the known message "poll: protocol failure in circuit setup":
# service xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
# rsh localhost pwd
poll: protocol failure in circuit setup
I have only been able to fix the problem in two ways: rebooting the system or going through level 2.
# init 2; sleep 1; init 3
# rsh localhost pwd
/root
I'd like to reach the root cause. It is not a firewall problem.
**This is the strace
output when it fails:**
(see highlighted passage)
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3 bind(3, {sa_family=AF_INET, sin_port=htons(1023), in_addr=inet_addr("0.0.0.0")}, 16) = 0 fcntl(3, F_SETOWN, 23277) = 0 connect(3, {sa_family=AF_INET, sin_port=htons(514), sin_addr=inet_addr("127.0.0.1")}, 16) = 0 socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 4 bind(4, {sa_family=AF_INET, sin_port=htons(1022), sin_addr=inet_addr("0.0.0.0")}, 16) = 0 listen(4, 1) = 0 write(3, "1022\0", 5) = 5 poll([{fd=3, events=POLLIN}, {fd=4, events=POLLIN}], 2, -1) = 1 ([{fd=3, revents=POLLIN|POLLERR|POLLHUP}]) write(2, "poll: protocol failure in circui"..., 40) = 40 close(4) = 0 close(3) = 0 rt_sigprocmask(SIG_SETMASK, [], [URG], 8) = 0 exit_group(1)**This is the
strace
output when it works fine:**
(see highlighted passage)
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3 bind(3, {sa_family=AF_INET, sin_port=htons(1023), in_addr=inet_addr("0.0.0.0")}, 16) = 0 fcntl(3, F_SETOWN, 24718) = 0 connect(3, {sa_family=AF_INET, sin_port=htons(514), sin_addr=inet_addr("127.0.0.1")}, 16) = 0 socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 4 bind(4, {sa_family=AF_INET, sin_port=htons(1022), sin_addr=inet_addr("0.0.0.0")}, 16) = 0 listen(4, 1) = 0 write(3, "1022\0", 5) = 5 poll([{fd=3, events=POLLIN}, {fd=4, events=POLLIN}], 2, -1) = 1 ([{fd=4, revents=POLLIN}]) accept(4, {sa_family=AF_INET, sin_port=htons(1020), in_addr=inet_addr("127.0.0.1")}, ) = 5 close(4) = 0 writev(3, [{"root\0", 5}, {"root\0", 5}, {"pwd\0", 4}], 3) = 14 read(3, "\0", 1) = 1 rt_sigprocmask(SIG_SETMASK, [], [URG], 8) = 0 setuid(0) = 0 rt_sigprocmask(SIG_BLOCK, [INT QUIT TERM], [], 8) = 0 rt_sigaction(SIGINT, {SIG_IGN, [INT], SA_RESTORER|SA_RESTART, 0x2abd2e3c1920}, {SIG_DFL, [], 0}, 8) = 0 rt_sigaction(SIGINT, {0x2abd2db30080, [INT], SA_RESTORER|SA_RESTART, 0x2abd2e3c1920}, {SIG_IGN, [INT], SA_RESTORER|SA_RESTART, 0x2abd2e3c1920}, 8) = 0 rt_sigaction(SIGQUIT, {SIG_IGN, [QUIT], SA_RESTORER|SA_RESTART, 0x2abd2e3c1920}, {SIG_DFL, [], 0}, 8) = 0 rt_sigaction(SIGQUIT, {0x2abd2db30080, [QUIT], SA_RESTORER|SA_RESTART, 0x2abd2e3c1920}, {SIG_IGN, [QUIT], SA_RESTORER|SA_RESTART, 0x2abd2e3c1920}, 8) = 0 rt_sigaction(SIGTERM, {SIG_IGN, [TERM], SA_RESTORER|SA_RESTART, 0x2abd2e3c1920}, {SIG_DFL, [], 0}, 8) = 0 rt_sigaction(SIGTERM, {0x2abd2db30080, [TERM], SA_RESTORER|SA_RESTART, 0x2abd2e3c1920}, {SIG_IGN, [TERM], SA_RESTORER|SA_RESTART, 0x2abd2e3c1920}, 8) = 0 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x2abd2eb893b0) = 24721 ioctl(5, FIONBIO, ) = 0 ioctl(3, FIONBIO, ) = 0 rt_sigprocmask(SIG_SETMASK, [], [INT QUIT TERM], 8) = 0 select(6, [3 5], NULL, NULL, NULL) = 1 (in ) read(3, "/root\n", 8192) = 6 write(1, "/root\n", 6) = 6 select(6, [3 5], NULL, NULL, NULL) = 1 (in ) read(3, "", 8192) = 0 select(6, , NULL, NULL, NULL) = 1 (in ) read(5, "", 8192) = 0 kill(24721, SIGKILL) = 0 exit_group(0) = ?Thank you in advance for your help. Best regards, Octavio
Octavio Rodriguez Perez
(11 rep)
Feb 14, 2021, 11:28 PM
• Last activity: Feb 22, 2021, 03:22 PM
5
votes
2
answers
18266
views
rsh shows "poll: protocol failure in circuit setup", why?
In the starting rsh worked properly, but after making some changes it shows some error [changes are shown in the end of this question, see that], I am sharing the same. **Command** $ /usr/bin/rsh localhost ulimit -n **Output** poll: protocol failure in circuit setup After facing this problem, I foll...
In the starting rsh worked properly, but after making some changes it shows some error [changes are shown in the end of this question, see that], I am sharing the same.
**Command**
$ /usr/bin/rsh localhost ulimit -n
**Output**
poll: protocol failure in circuit setup
After facing this problem, I followed this link , but didn't get any help.
It works properly, but when I made some changes, from this link , then after that it shows the output as above. Now I revert all changes, but it shows the same output. Why?
These are the lines that I added in files, showing in left hand side, by seeing the above link.
/etc/pam.d/login: session required pam_limits.so
/etc/pam.d/sshd: session required pam_limits.so
/etc/pam.d/su: session required pam_limits.so
/etc/pam.d/system-auth: session required pam_limits.so
Here is the link of what I am trying to do.
**Edit No. 1**
strace -o log.txt rsh localhost pwd
, some lines of output are as,
connect(3, {sa_family=AF_INET, sin_port=htons(514), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 4
bind(4, {sa_family=AF_INET, sin_port=htons(1022), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
listen(4, 1) = 0
write(3, "1022\0", 5) = 5
poll([{fd=3, events=POLLIN}, {fd=4, events=POLLIN}], 2, -1) = 1 ([{fd=3, revents=POLLIN|POLLERR|POLLHUP}])
write(2, "poll: protocol failure in circui"..., 40) = 40
close(4) = 0
close(3) = 0
rt_sigprocmask(SIG_SETMASK, [], [URG], 8) = 0
exit_group(1)
**Edit no. 2**
**Command** - strace ~/rshd.trace in.rshd
**Output**
execve("/usr/sbin/in.rshd", ["in.rshd"], [/* 22 vars */]) = 0
brk(0) = 0x2b3054ec2000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b303671d000
uname({sys="Linux", node="jhamb.XXX.XXX", ...}) = 0
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b303671e000
arch_prctl(ARCH_SET_FS, 0x2b303671e6d0) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
devsda
(437 rep)
Mar 18, 2013, 10:25 AM
• Last activity: Feb 14, 2021, 11:15 PM
-1
votes
2
answers
213
views
Why rsh not opens and reads PAM modules and limits.conf?
I am working on a project, that uses rsh utility for remote connection. But my project needs some extra features for that, so I add that features. Till now, all the things are going fine. But when I take a `strace` on rsh server. It shows that it opens and reads PAM modules and limits.conf. But the...
I am working on a project, that uses rsh utility for remote connection.
But my project needs some extra features for that, so I add that features.
Till now, all the things are going fine. But when I take a
strace
on rsh server. It shows that it opens and reads PAM modules and limits.conf.
But the rsh, that I made is not able to open and read PAM module and limits.conf.
I followed this link to check above things.
Number of calling of PAM module and all these things are exactly same in Standard rsh and mine rsh.
**The reasons that I think, behind this weird behavior** :-
1. May be configure
file does not load by makefile
of mine rsh.
2. May be it does not load MCONFIG
, MRULES
in makefile.
But I didn't understand how can I confirm my doubt, and remove this problem.
I tried to use GDB debugger, but I am unable to locate where this problem occurs.
devsda
(437 rep)
Mar 25, 2013, 08:46 AM
• Last activity: Mar 9, 2019, 03:21 PM
0
votes
0
answers
267
views
login with rsh having zero size terminal (stty)
I've received a very peculiar problem all of sudden to the Linux hosts while doing rsh to them from a remote site and them opening a file it returns the file opened very limited on the terminal saying that the `stty size` shows `0 0`. Secondly, this is not limited to a particular hosts its for all t...
I've received a very peculiar problem all of sudden to the Linux hosts while doing rsh to them from a remote site and them opening a file it returns the file opened very limited on the terminal saying that the
I'm just suspecting if a N/W change like at the switch/routing level for network may impact this.
Linux releases :
----------------
RedHat: all versions
CentOS: all versions
stty size
shows 0 0
.
Secondly, this is not limited to a particular hosts its for all the users whosoever doing rsh to the remote machine over the WAN.
Another weird scene is that , if we do rsh from some near WAN location the it works fine while others not.
$ stty size
0 0
Client connections & OS:
------------------------
Both Source and Destination are using same OS.
Below is Just an example while opening a file it only opens up to half window.

Karn Kumar
(145 rep)
Mar 8, 2019, 02:10 PM
• Last activity: Mar 8, 2019, 06:10 PM
-1
votes
2
answers
80
views
Getting size of 40k paths from remote network
I've around 40k lines of file with paths which I need to take size from remote site (using `rsh` & `du -scL` command). I tried with `while read line` but due to remote connection, it exits after 100+ lines. So I tried to copy all the lines in to a file with `du -scL` and input the file in to one `rs...
I've around 40k lines of file with paths which I need to take size from remote site (using
rsh
& du -scL
command). I tried with while read line
but due to remote connection, it exits after 100+ lines. So I tried to copy all the lines in to a file with du -scL
and input the file in to one rsh
but again it's crashed saying 'command too long'. I need to do a script which calc the size of all these paths from remote site using rsh
and du
.
#!bin/bash
for line in cat $destbang1
do
rsh vnc. du -sL $line | awk '{print $1}' >> /tmp/size1.txt
done
total=gawk '{ sum += $1 }; END { print sum}' /tmp/size1.txt
echo $total
Ratheesh P
(1 rep)
Sep 11, 2017, 09:24 AM
• Last activity: Jan 6, 2019, 09:34 PM
1
votes
1
answers
1307
views
How enable non-privileged user to connect using rsh?
I have two hosts with Red Hat 7.4 , HostA and HostB. The rsh-server and rsh packages was installed in both. At both hosts, the rsh deamon was activated, the commands `rsh,rlogin,rexec` was added to `/etc/securetty`, at `/etc/hosts.equiv` the `HostA` and `HostB` was added. From **hostA**, with root,...
I have two hosts with Red Hat 7.4 , HostA and HostB.
The rsh-server and rsh packages was installed in both.
At both hosts, the rsh deamon was activated, the commands
rsh,rlogin,rexec
was added to /etc/securetty
, at /etc/hosts.equiv
the HostA
and HostB
was added.
From **hostA**, with root, when I run rsh hostb
, connects successfully without ask password.
From **hostA**, with any other user, give the error : rcmd: socket: Permission denied
.
From **hostB**, with root, when I run rsh hosta
, connects successfully without ask password.
From **hostB**, with any other user, connects successfully without ask password.
I already try add the set bit : chmod +a $(which rsh)
, but have no effect.
The SELINUX is disabled on both hosts.
The firewall is disabled on both hosts.
ceinmart
(511 rep)
Feb 26, 2018, 03:02 PM
• Last activity: Feb 26, 2018, 05:05 PM
0
votes
0
answers
1636
views
Unable to do RSH connection
I have two servers with RHEL 6.6 installed. I'm trying to do an RSH connection between these two. Following are the errors which I'm getting: connect to address 172.21.70.95 port 544: Connection refused trying normal rsh (/usr/bin/rsh) poll: protocol failure in circuit setup One server was able to d...
I have two servers with RHEL 6.6 installed. I'm trying to do an RSH connection between these two. Following are the errors which I'm getting:
connect to address 172.21.70.95 port 544: Connection refused
trying normal rsh (/usr/bin/rsh)
poll: protocol failure in circuit setup
One server was able to do the RSH connection to a third server when it was on another network. But on this network, it is not able to do the same.
Same configurations are done here on this network and on both the servers but still, I'm facing this issue.
Amit24x7
(676 rep)
Jun 16, 2017, 03:29 PM
0
votes
0
answers
1343
views
rsh Temporary failure in name resolution
I am trying to use RSH commands using for example: `rsh -l root 10.0.2.5 "ls"` When I run this command I get getnameinfo: Temporary failure in name resolution but I get a shell by just running `rsh -l root 10.0.2.5` How do I fix this issue? (I have to use RSH, I am exploiting this service suggesting...
I am trying to use RSH commands using for example:
rsh -l root 10.0.2.5 "ls"
When I run this command I get
getnameinfo: Temporary failure in name resolution
but I get a shell by just running rsh -l root 10.0.2.5
How do I fix this issue? (I have to use RSH, I am exploiting this service suggesting a switch would defy the point)
TheHidden
(808 rep)
Jun 5, 2017, 09:40 AM
• Last activity: Jun 6, 2017, 07:49 PM
1
votes
0
answers
517
views
Enabling rsh / rlogin with pam in amazon linux
**Please don't even think of suggesting to use ssh. I use ssh and I know how to use it. But sometimes I just want to use rsh! There are good reasons to do so, if you know what you are doing!** actually I never really understood pam but I assume that pam is my problem on this amazon linux system I tr...
**Please don't even think of suggesting to use ssh. I use ssh and I know how to use it. But sometimes I just want to use rsh! There are good reasons to do so, if you know what you are doing!**
actually I never really understood pam but I assume that pam is my problem on this amazon linux system I try to configure.
In our days password driven logins to machines is nothing you really want, and communicating with remote machines in plain-text is not usefull either. So anytime when I talk to a AWS Instance my communication flows through a VPN Tunnel and is encrypted by that tunnel.
So I'm trying to use rsh / rlogin for my AWS machines. I did that before in some gentoo linux distributions and it was easy enough to setup rsh to communicate through openvpn tunneled private IP addresses.
The whole r* stuff works fine and the .rhosts mechanism lets my user through and starts the login process to continue with the session.
The next thing I see then is just EXIT (in my remote console and in the syslog).
In the strace it looks as if login immediately hangs up.
I assume that is a PAM feature, but I cannot debug pam, nor can I read these interleaved pam configuration files. Using /etc/pam_debug does not work. I never got a pam_echo, I can't see any debug output from pam, though the syslogger has debug messages enabled and I can see these debug messages from other services. But not from pam.
I used the strace method, so I can see that the r* realm has already been left and the rlogind already started login for my user, to be logged in, so you don't need to answer what I might need to configure to get rsh / rlogin running. They just do.
If I could get a session for that rlogin from the login process, I think I would be ready to use rsh / rlogin.
Here is the login configuration file from /etc/pam.d:
#%PAM-1.0
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
auth substack system-auth
auth include postlogin
account required pam_nologin.so
account include system-auth
password include system-auth
# pam_selinux.so close should be the first session rule
session required pam_selinux.so close
session required pam_loginuid.so
session optional pam_console.so
# pam_selinux.so open should only be followed by sessions to be executed in the user context
session required pam_selinux.so open
session required pam_namespace.so
session optional pam_keyinit.so force revoke
session include system-auth
session include postlogin
-session optional pam_ck_connector.so
The working gentoo login configuration mainly comes from "system-login":
auth required pam_tally2.so onerr=succeed
auth required pam_shells.so
auth required pam_nologin.so
auth include system-auth
account required pam_access.so
account required pam_nologin.so
account include system-auth
account required pam_tally2.so onerr=succeed
password include system-auth
session optional pam_loginuid.so
session required pam_env.so
session optional pam_lastlog.so silent
session include system-auth
session optional pam_motd.so motd=/etc/motd
session optional pam_mail.so
Thanks for any hints!
ikrabbe
(2203 rep)
Jan 25, 2017, 03:46 PM
• Last activity: Jan 27, 2017, 02:04 PM
4
votes
1
answers
521
views
Execute script on a remote server contained on client side
I am trying to figure out how I could manage more easily my servers. I'd like to know if I can make my scripts available to all the servers without copying them to the servers. They are located in my computer (client side), bash-3.2$ ls -l my_local_script -rwxr--r-- 1 mario staff 554 Jan 9 13:35 my_...
I am trying to figure out how I could manage more easily my servers. I'd like to know if I can make my scripts available to all the servers without copying them to the servers.
They are located in my computer (client side),
bash-3.2$ ls -l my_local_script
-rwxr--r-- 1 mario staff 554 Jan 9 13:35 my_local_script
I always login remotely with my terminal using SSH
bash-3.2$ ssh root@192.168.56.140
root@192.168.56.140's password:
[root@prodsrvr00 ~]#
Once I am logged into the server, I'd like to know if there is any way to execute the script like it was locally available without copying it to the server.
[root@prodsrvr00 ~]# my_local_script
Since it's a NAT network, I cannot SSH back to my computer (the client).
mrgamertag
(41 rep)
Jan 9, 2017, 11:16 PM
• Last activity: Jan 21, 2017, 05:39 PM
0
votes
1
answers
418
views
RSH closing stderr socket with a delay?
Environment: CentOS 6.6 When running this simple test (from `myclient`): while true; do rsh myserver "echo OK"; done After ~500 iterations, the server runs out of ports. `netstat -anp` on the server shows: tcp 0 0 myserver:1008 myclient:922 TIME_WAIT - tcp 0 0 myserver:975 myclient:922 TIME_WAIT - t...
Environment: CentOS 6.6
When running this simple test (from
myclient
):
while true; do rsh myserver "echo OK"; done
After ~500 iterations, the server runs out of ports.
netstat -anp
on the server shows:
tcp 0 0 myserver:1008 myclient:922 TIME_WAIT -
tcp 0 0 myserver:975 myclient:922 TIME_WAIT -
tcp 0 0 myserver:998 myclient:922 TIME_WAIT -
tcp 0 0 myserver:991 myclient:922 TIME_WAIT -
tcp 0 0 myserver:1007 myclient:922 TIME_WAIT -
tcp 0 0 myserver:1000 myclient:922 TIME_WAIT -
tcp 0 0 myserver:990 myclient:922 TIME_WAIT -
tcp 0 0 myserver:979 myclient:922 TIME_WAIT -
tcp 0 0 myserver:1003 myclient:922 TIME_WAIT -
tcp 0 0 myserver:988 myclient:922 TIME_WAIT -
tcp 0 0 myserver:984 myclient:922 TIME_WAIT -
tcp 0 0 myserver:1002 myclient:922 TIME_WAIT -
tcp 0 0 myserver:997 myclient:922 TIME_WAIT -
tcp 0 0 myserver:1019 myclient:922 TIME_WAIT -
tcp 0 0 myserver:995 myclient:922 TIME_WAIT -
tcp 0 0 myserver:993 myclient:922 TIME_WAIT -
tcp 0 0 myserver:1004 myclient:922 TIME_WAIT -
tcp 0 0 myserver:1017 myclient:922 TIME_WAIT -
tcp 0 0 myserver:1013 myclient:922 TIME_WAIT -
tcp 0 0 myserver:1011 myclient:922 TIME_WAIT -
tcp 0 0 myserver:1009 myclient:922 TIME_WAIT -
tcp 0 0 myserver:994 myclient:922 TIME_WAIT -
tcp 0 0 myserver:987 myclient:922 TIME_WAIT -
tcp 0 0 myserver:986 myclient:922 TIME_WAIT -
tcp 0 0 myserver:1012 myclient:922 TIME_WAIT -
tcp 0 0 myserver:1010 myclient:922 TIME_WAIT -
tcp 0 0 myserver:1014 myclient:922 TIME_WAIT -
tcp 0 0 myserver:996 myclient:922 TIME_WAIT -
922
is the RSH stderr port (from monitoring with wireshark).
After approximatively one minute, the sockets are closed on the server and new connections can be made.
So it seems the client or the server fails to properly close these sockets, and they just timeout.
Is this a bug in rsh ?
Any idea to work around this ? I can see BSD's rsh has a --no-stderr
option, but Linux does not seem to.
nicoulaj
(471 rep)
Feb 24, 2016, 11:45 AM
• Last activity: Sep 17, 2016, 12:59 AM
1
votes
1
answers
519
views
can't run "lspci" command using rsh from a windows batch file
I've made a batch file on a Windows machine, with the following command: rsh hdvg-1 -l root lspci The `hdvg-1` is the name of the Linux machine on the network. But what I get in result is: `command not found`. Can someone tell me what i am doing wrong? Perhaps also help me to use the following comma...
I've made a batch file on a Windows machine, with the following command:
rsh hdvg-1 -l root lspci
The
hdvg-1
is the name of the Linux machine on the network.
But what I get in result is: command not found
. Can someone tell me what i am doing wrong?
Perhaps also help me to use the following command in order to filter the lspci result:
lspci | grep 'certain string
R T
(11 rep)
Aug 27, 2016, 02:26 PM
• Last activity: Aug 28, 2016, 01:47 PM
3
votes
3
answers
3906
views
Command to trace rsh server to check behaviour of particular system call
I am working with `rsh`. I want to check the whole process from beginning to end. For that I used `strace`. Os name is CentOS. I am working on single machine, server and client are on same machine. My command is , `rsh localhost ulimit -n` To take a trace, I used `strace rsh localhost ulimit -n`. I...
I am working with
rsh
. I want to check the whole process from beginning to end. For that I used strace
.
Os name is CentOS. I am working on single machine, server and client are on same machine.
My command is , rsh localhost ulimit -n
To take a trace, I used strace rsh localhost ulimit -n
.
I read all the files that is open during executing above command. But I want to trace how the rsh server sets the limit of ulimit -n
, because all commands in rsh run by rsh daemon.
The system call I am looking for is, setrlimit
, but it didn't show this system call by using strace rsh localhost ulimit -n
.
For that I have to trace rsh server , i.e, rsh daemon. But I don't know, how I perform this task.
Please tell me the command and their explanations also.
**I know rsh is not used in current scenario, but my project is using that, so please don't tell , rsh is not good. I know all these stuffs.**
**Edit No. 1**
$ sudo lsof -i :514
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
syslogd 2210 root 9u IPv4 6259 UDP *:syslog
xinetd 2658 root 8u IPv4 8745 TCP *:shell (LISTEN)
and, /etc/xinetd.d
, does not contain rshd, it contains rsh, rexec, rlogin, rsync, etc.
**Edit no 2** [related to comment by Chris Down]
rsh localhost strace -o log_new bash -c 'ulimit -n'
It gives different answer that it gives when I run strace rsh localhost ulimit -n
execve("/bin/bash", ["bash", "-c", "ulimit", "-n"], [/* 15 vars */]) = 0
brk(0) = 0x13e86000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2af7bbab2000
uname({sys="Linux", node="jhamb.XXX.XXX", ...}) = 0
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=57641, ...}) = 0
mmap(NULL, 57641, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2af7bbab3000
close(3) = 0
open("/lib64/libtermcap.so.2", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\17\300T4\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=15584, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2af7bbac2000
mmap(0x3454c00000, 2108688, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3454c00000
mprotect(0x3454c03000, 2093056, PROT_NONE) = 0
mmap(0x3454e02000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x3454e02000
close(3) = 0
open("/lib64/libdl.so.2", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\16@T4\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=23360, ...}) = 0
mmap(0x3454400000, 2109696, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3454400000
mprotect(0x3454402000, 2097152, PROT_NONE) = 0
mmap(0x3454602000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x3454602000
close(3) = 0
open("/lib64/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\332\1T4\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1726320, ...}) = 0
mmap(0x3454000000, 3506520, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3454000000
mprotect(0x345414f000, 2097152, PROT_NONE) = 0
mmap(0x345434f000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14f000) = 0x345434f000
mmap(0x3454354000, 16728, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3454354000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2af7bbac3000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2af7bbac4000
arch_prctl(ARCH_SET_FS, 0x2af7bbac3dd0) = 0
mprotect(0x3454602000, 4096, PROT_READ) = 0
mprotect(0x345434f000, 16384, PROT_READ) = 0
mprotect(0x3453e1c000, 4096, PROT_READ) = 0
munmap(0x2af7bbab3000, 57641) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
open("/dev/tty", O_RDWR|O_NONBLOCK) = -1 ENXIO (No such device or address)
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffb504cb00) = -1 EINVAL (Invalid argument)
brk(0) = 0x13e86000
brk(0x13ea7000) = 0x13ea7000
getuid() = 500
getgid() = 500
geteuid() = 500
getegid() = 500
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
open("/proc/meminfo", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2af7bbab3000
read(3, "MemTotal: 3920228 kB\nMemFre"..., 4096) = 777
close(3) = 0
munmap(0x2af7bbab3000, 4096) = 0
rt_sigaction(SIGCHLD, {SIG_DFL, [], SA_RESTORER, 0x3454030330}, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGCHLD, {SIG_DFL, [], SA_RESTORER, 0x3454030330}, {SIG_DFL, [], SA_RESTORER, 0x3454030330}, 8) = 0
rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x3454030330}, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x3454030330}, {SIG_DFL, [], SA_RESTORER, 0x3454030330}, 8) = 0
rt_sigaction(SIGQUIT, {SIG_DFL, [], SA_RESTORER, 0x3454030330}, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGQUIT, {SIG_DFL, [], SA_RESTORER, 0x3454030330}, {SIG_DFL, [], SA_RESTORER, 0x3454030330}, 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
rt_sigaction(SIGQUIT, {0x1, [], SA_RESTORER, 0x3454030330}, {SIG_DFL, [], SA_RESTORER, 0x3454030330}, 8) = 0
uname({sys="Linux", node="jhamb.XXX.XXX", ...}) = 0
stat("/home/service", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
stat(".", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
getpid() = 30873
getppid() = 30829
stat(".", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
stat("/home/service/bin/bash", 0x7fffb504cab0) = -1 ENOENT (No such file or directory)
stat("/usr/local/sbin/bash", 0x7fffb504cab0) = -1 ENOENT (No such file or directory)
stat("/usr/local/bin/bash", 0x7fffb504cab0) = -1 ENOENT (No such file or directory)
stat("/usr/sbin/bash", 0x7fffb504cab0) = -1 ENOENT (No such file or directory)
stat("/sbin/bash", 0x7fffb504cab0) = -1 ENOENT (No such file or directory)
stat("/usr/kerberos/bin/bash", 0x7fffb504cab0) = -1 ENOENT (No such file or directory)
stat("/usr/bin/bash", 0x7fffb504cab0) = -1 ENOENT (No such file or directory)
stat("/bin/bash", {st_mode=S_IFREG|0755, st_size=801512, ...}) = 0
access("/bin/bash", X_OK) = 0
access("/bin/bash", R_OK) = 0
stat("/bin/bash", {st_mode=S_IFREG|0755, st_size=801512, ...}) = 0
access("/bin/bash", X_OK) = 0
access("/bin/bash", R_OK) = 0
getpgrp() = 30829
rt_sigaction(SIGCHLD, {0x436080, [], SA_RESTORER, 0x3454030330}, {SIG_DFL, [], SA_RESTORER, 0x3454030330}, 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
getpeername(0, {sa_family=AF_INET, sin_port=htons(61000), sin_addr=inet_addr("127.0.0.1")}, ) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
getrlimit(RLIMIT_FSIZE, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0
fstat(1, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2af7bbab3000
write(1, "unlimited\n", 10) = 10
exit_group(0) = ?
**Edit No.3**
# grep -e ulimit -e setrlimit rsh.strace.
rsh.strace.31472:14:22:42.966361 setrlimit(RLIMIT_NOFILE, {rlim_cur=1024, rlim_max=1024}) = 0
rsh.strace.31474:14:22:43.085822 execve("/bin/bash", ["bash", "-c", "ulimit -n"], [/* 4 vars */]) = 0
rsh.strace.31474:14:22:43.546754 setrlimit(RLIMIT_CORE, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0
**Edit No. 4: /etc/security/limits.conf
with comments removed**
* soft core unlimited
* hard core unlimited
@service hard nofile 13000
@service soft nofile 13000
* soft nofile 12000
* hard nofile 12000
devsda
(437 rep)
Mar 19, 2013, 07:07 AM
• Last activity: Jul 16, 2016, 01:06 AM
3
votes
2
answers
1071
views
Ways to optimize performance in pipelines over network (RSH and SSH)
Consider a data transfer over a pipeline network in legacy systems with remote shell (RSH), like: rsh host -l user tar -cf - /home/dir \| compress | uncompress | tar -xvf - and this one in 'modern' systems: ssh user@host tar -cf - /home/dir \| gzip | ungzip | tar -xvf - **PERFORMANCE ISSUES:** I exp...
Consider a data transfer over a pipeline network in legacy systems with remote shell (RSH), like:
rsh host -l user tar -cf - /home/dir \| compress | uncompress | tar -xvf -
and this one in 'modern' systems:
ssh user@host tar -cf - /home/dir \| gzip | ungzip | tar -xvf -
**PERFORMANCE ISSUES:**
I experienced a very bad performance running a transfer among AIX 4.3 to AIX 5.3 using RSH. Even having idle cards (10/100) connecting them through an idle switch, I got a performance about 350Kbps transferring 5.4GB.
When running this transferring among AIX 5.3 and Linux, but now using SSH and gzip, the performance is way better, but never reachs the network capacity (In a 1 Gigabit LAN I got an average of about 400Mbps).
Are there ways to optimize the network pipeline performance maybe customizing pipe buffers or network block/buffers, or what ?
Luciano
(1189 rep)
Feb 17, 2016, 02:18 PM
• Last activity: Feb 18, 2016, 10:09 PM
Showing page 1 of 20 total questions