Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
I am following below process for rsh login from server 1 to server2.
I have done below changes in Server 2
1.To ensure that the rsh and rsh-server packages are installed, type the following command:# rpm -qa | grep -i rsh
If it is not already in the file, type the following command to append the line "rsh" to the /etc/securetty file:
# echo "rsh" >> /etc/securetty
2.Modify /etc/init.d/rsh disable=no.
3.In the /etc/pam.d/rsh file, change the "auth" type from "required" to "sufficient":auth sufficient
4.Add the "promiscuous" flag into /etc/pam.d/rsh and /etc/pam.d/rlogin after item "pam_rhosts_auth.so".
5.To enable the rsh server, type the following command:# chkconfig rsh on
Other than that i have also tried below options:
1. Add 'rsh' and 'rlogin' to /etc/securetty
2. Add all IPs to /root/.rhosts, and chmod 600 /root/.rhosts
3. Set "disable = no" in /etc/xinetd.d/{rsh,rlogin}
4. chkconfig xinetd on ; /etc/init.d/xinetd restart
But when running command "rsh -l root server2ip hostname", i am getting error "connection refused".
"connection refused" tells you the client seems to find the server process not listening.
This could be because your xinetd work failed or you have firewall rules that make it look that way.
Code:
netstat -an | grep LISTEN
iptables -L
And why would anyone use rsh these days instead of ssh?
I tried SSH as well but the issue is it is asking for password. Even after executing below procedure SSH is asking for password.... so had to try for RSH... can it be some port open issues. Since there are Cisco router between servers.
Sorry, but the solution is to fix your set up so that passwordless ssh works, not to switch back to an ancient and insecure protocol like rsh. Passwordless ssh will work (I use it all the time, as root, but with passphrase protected keys). You just have to configure it correctly. One of the top mistakes made is not having the permissions correctly set on the user's home directory or their .ssh directory and the files within it. If you bump up the log level of sshd, it will tell you exactly why it rejected key based authentication. System logs exist for a reason, and you need to get into the habit of reading them. It's also possible that root logins over ssh are disabled, which is generally a good practice. Is it possible to accomplish what you want by ssh'ing as a normal user (using a key) and then using sudo without a password to run one specific command?
To answer your question regarding linosaurus's advice, the netstat command will tell you if something is listening on the rsh port, and the "iptables -L" command shows the currently active packet filter rules, which will tell you which ports remote machines are allowed to connect to based on the current firewall rules for your servers. if you don't understand how to interpret this information, please post here and ask questions, however be aware that doing things like this are a basic part of server administration that you will need to come up to speed on. But again - don't use rsh, fix up ssh to do what you need it to! I cannot stress this enough.
I tried SSH as well but the issue is it is asking for password. Even after executing below procedure SSH is asking for password.... so had to try for RSH... can it be some port open issues. Since there are Cisco router between servers.
thanks for the response.... basically i am just trying to develop a script which will run from in 2 different linux servers using ssh. i have done all the changes as per the link (shared earlier) for passwordless ssh and also with required permission... still not successful... i will still continue to troubleshoot...
Pl let me know if u have any procedure with which i can do passwordless ssh?
thanks for the response.... basically i am just trying to develop a script which will run from in 2 different linux servers using ssh. i have done all the changes as per the link (shared earlier) for passwordless ssh and also with required permission... still not successful... i will still continue to troubleshoot...
Pl let me know if u have any procedure with which i can do passwordless ssh?
you have checked the permissions on both servers for ~/.ssh and the files inside? if any one file or directory has bad permissions the passwordless entries will fail.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.