Linux - EnterpriseThis forum is for all items relating to using Linux in the Enterprise.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
...once again, I'm obviously a newbie with a question like this but here's a chance to solve a simple issue and in the process show that you are smarter than me. %-)
I'm trying to configure and enable rsh on a node in a small Linux cluster (RHEL 5).
I've modified
/etc/xinetd.d/rsh
/etc/xinetd.d/rlogin
/etc/xinetd.d/rexec
to set "disable = no"
added lines for rsh and rlogin to /etc/securetty
and then issued a #services xinetd restart
but when I try to test rsh locally on the node, I get the following:
[root@C1-N1 ~]# rsh localhost
connect to address 127.0.0.1 port 543: Connection refused
Trying krb4 rlogin...
connect to address 127.0.0.1 port 543: Connection refused
trying normal rlogin (/usr/bin/rlogin)
Password:
I imagine I've made a really simple mistake somewhere along the way...do you know where I've gone wrong?
Thanks in advance for any help you can offer on this!
Yes SSH might be better than RSH, but rsh can allow commands to be sent.
As I want to script some actions from a remote host that are to be performed on the target, rsh is better.
Without knowing what /root/tools/machines does or contains, I'll assume it has the hostnames on separate lines in it. If so, then you could try:
Code:
#!/bin/bash
# Iterate through each remote host in the file /root/tools/machines
while read rhost; do
ssh root@$rhost "/sbin/shutdown -h now"
done < /root/tools/machines
You'll have to ssh in as root (often considered a bad idea), or set up sudo to allow a different, less privileged user to execute /sbin/shutdown.
Edit: You can also specify users who are allowed to shutdown the machine in /etc/shutdown.allow without the need to set up sudo. You do need to pass -a to the shutdown command, though. See man shutdown for more info.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.