LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   problem with rsh (https://www.linuxquestions.org/questions/linux-newbie-8/problem-with-rsh-716522/)

ssenthilkumar 04-03-2009 02:28 AM

problem with rsh
 
i m trying to write script using perl and that too with rsh ..

problem here is i m getting this message..

connect to address 192.168.20.172: Connection refused
Trying krb4 rlogin...
connect to address 192.168.20.172: Connection refused
trying normal rlogin (/usr/bin/rlogin)
192.168.20.172: Connection refused

how to overcome and i have to complete this... pls help regarding this

maxy7710 04-03-2009 02:37 AM

CPCAPP108 & CPCAPP110 are 2 servers who need rsh to & fro

==================|
CPCAPP108 config:-|
==================|

vim /etc/hosts.equiv
CPCAPP110

vim /root/.rhosts
CPCAPP110

Set the permissions on the file to 600.

chmod 600 /root/.rhosts

vim /etc/securetty
rsh
rlogin

vim /etc/xinetd.d/rsh
disable = no

vim /etc/xinetd.d/rlogin
disable = no

3 files /usr/bin/rsh /usr/bin/rcp /usr/bin/rlogin should have SUID bit set on it

i.e chmod u+s /usr/bin/rsh /usr/bin/rcp /usr/bin/rlogin

/etc/init.d/xinetd restart

then do rsh CPCAPP108 from CPCAPP110 server.

==================|
CPCAPP110 config:-|
==================|

vim /etc/hosts.equiv
CPCAPP108

vim /root/.rhosts
CPCAPP108

Set the permissions on the file to 600.

chmod 600 /root/.rhosts

vim /etc/securetty
rsh
rlogin

vim /etc/xinetd.d/rsh
disable = no

vim /etc/xinetd.d/rlogin
disable = no

3 files /usr/bin/rsh /usr/bin/rcp /usr/bin/rlogin should have SUID bit set on it

i.e chmod u+s /usr/bin/rsh /usr/bin/rcp /usr/bin/rlogin

/etc/init.d/xinetd restart

then do rsh CPCAPP110 from CPCAPP108 server.

maxy7710 04-03-2009 02:39 AM

Also make the necessary entries in /etc/hosts

I'll like to tell u rsh is not secured, instead if possible use ssh

I hope it helps

ssenthilkumar 04-03-2009 03:58 AM

Quote:

Originally Posted by maxy7710 (Post 3496927)
Also make the necessary entries in /etc/hosts

I'll like to tell u rsh is not secured, instead if possible use ssh

I hope it helps

thanks...

but now my officials are saying to use ssh .. but due to its high security, i cant make my perl scripts to execute commands in another system... u got the problem??..

maxy7710 04-03-2009 04:18 AM

Can u elaborate what problem r u facing

ssenthilkumar 04-03-2009 06:54 AM

Quote:

Originally Posted by maxy7710 (Post 3496993)
Can u elaborate what problem r u facing

actually i am trying to run a perl script on say like i m working in system1, ill try to access a perl script that is there in system2, through ssh (previously rsh, but tats not working for debian.. i m using debian)...

but ssh is asking me password every time and after giving password i can access through the terminal and not with my script (perl script not working, the initial connection to system2 can be made thro' perl script), rest i am using terminal.. so its not automation at all...


my officials r saying tat, bcos of security in ssh, i cant able to run my script ..so kindly help me..

maxy7710 04-03-2009 07:12 AM

if u want to access ssh without that can be done.

if u want password less connection between server 1 to server 2 for root user then login on server 1 thru root.

then use command ssh-keygen -t rsa, it will generate rsa key pair. keep pressing enter it will make the rsa key for u.
copy this key & login to server2 using root & paste the key in /root/.ssh/authorized_keys file.if the file does not exist then create it using touch.

if .ssh folder is not there then just ssh server1 from server2 & u will get the .ssh folder.

once key of server1 is placed in server2 then u can ssh from server1 to server2 without password.

choogendyk 04-03-2009 07:21 AM

see http://sial.org/howto/openssh/publickey-auth/ for howto on setting up automatic ssh logins. For security reasons, I wouldn't do it as root.


All times are GMT -5. The time now is 06:14 PM.