LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 05-23-2014, 06:05 AM   #1
deepdhiman
LQ Newbie
 
Registered: May 2014
Posts: 6

Rep: Reputation: Disabled
RSH login


Hi,

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".

Pl help
 
Old 05-23-2014, 06:51 AM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
"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?
 
Old 05-23-2014, 08:26 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,355

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
This x 1000
Quote:
And why would anyone use rsh these days instead of ssh?
http://www.informit.com/articles/art...p=169465&rll=1
 
Old 05-24-2014, 12:26 AM   #4
deepdhiman
LQ Newbie
 
Registered: May 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
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.

https://sort.symantec.com/public/doc...all/apds02.htm

What should i check after running the below commands:
netstat -an | grep LISTEN
iptables -L
 
Old 05-24-2014, 09:52 AM   #5
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
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.
 
1 members found this post helpful.
Old 05-24-2014, 03:02 PM   #6
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Quote:
Originally Posted by deepdhiman View Post
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.

https://sort.symantec.com/public/doc...all/apds02.htm

What should i check after running the below commands:
netstat -an | grep LISTEN
iptables -L
follow the directions in my signature link for how to fix your ssh keyless access.
 
1 members found this post helpful.
Old 05-28-2014, 02:14 AM   #7
deepdhiman
LQ Newbie
 
Registered: May 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Dear btmiller

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?
 
Old 05-28-2014, 05:09 AM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,355

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
You say you've tried to setup passwordless ssh, so show us what you get when you use
Code:
ssh -vvv ...
That means lots of verbose output.
 
Old 05-28-2014, 08:14 AM   #9
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Quote:
Originally Posted by deepdhiman View Post
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.
 
Old 06-06-2014, 02:31 AM   #10
deepdhiman
LQ Newbie
 
Registered: May 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanks guys issue is resolved... i am able to do passwordless ssh...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rsh connection closed after successful login BoraxMan Linux - Server 16 06-29-2021 10:01 AM
RSH login/connection slows down when one of DNS go down vrtareg Linux - Server 1 03-29-2012 08:02 PM
Can't login with rsh Darrell22 Linux - General 3 07-23-2009 02:04 PM
Remote login with RSH not working atulyahigh Linux - Software 2 02-11-2008 04:05 AM
RSH: remuser too long error when rsh is executed from IIS dev33445 Programming 0 08-29-2005 09:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration