1829161 Members
10655 Online
109986 Solutions
New Discussion

Re: rcp to localhost

 
SOLVED
Go to solution
matt_43
New Member

rcp to localhost

Hi

I am really new to linux so this may be a dumb question. Well I am testing some perl scripts and all I want to do is rcp to myself (localhost). But I keep getting connection refused.

I am running redhat 7.2 and logged on as root. I did a workstation installation. Oh I also read the rcp top read solution but it didn't help.

Is there a flag somewhere I have to turn to activate rcp?
9 REPLIES 9
Eric Ladner
Trusted Contributor

Re: rcp to localhost

Check your /etc/xinetd.d directory and see if a file named exec or rexec exists in it.

If not, you probably have to download rsh-server-.i386.rpm and install it.

It doesn't get installed by default for most configs.
matt_43
New Member

Re: rcp to localhost

Ya I have got that directory. I did install the rsh-server but I still got the connection refused.
Stuart Browne
Honored Contributor
Solution

Re: rcp to localhost

Thigns to check:

/root/.rhosts:
This file says what machines can access your machine without prompting for a password. In this scenario, it should contain 'localhost'. If that doesn't work, you'll need to check /var/log/messages to see where the system thinks the connection is being initiated from.

/etc/pam.d/rsh:
This file will say whether the 'root' user can 'rsh' and do such commands from pseudo tty's. Comment out the line "/lib/security/pam_securetty.so". WARNING: This does open your machine up somewhat. If you can avoid doing 'r' commands as 'root', I would.

"chkconfig --list rsh"
This command should return 'rsh on'. If not, then 'rsh' commands won't work. If you need to change it, these two commands must be executed:

chkconfig rsh on
/etc/rc.d/init.d/xinetd restart

This will enable 'rsh', and restart the 'xinetd' process (which is what actually answers the connection request).

Hope this gives you some help on where to head.
One long-haired git at your service...
Mark Fenton
Esteemed Contributor

Re: rcp to localhost

Matt,

Also check /etc/xinetd.d/rsh

by default, even if installed, the service is disabled. Enable by replacing
" disable = yes"
with
" disable = no"
and then restart xinetd.

Or better yet, get openssh and install it. Remote shell access that's secure. What a concept.

hth
Mark
Stuart Browne
Honored Contributor

Re: rcp to localhost

Umm, Mark, those checks on 'xinet.d/' are already covered. That's what 'chkconfig --list rsh' is for. It will state whether it's enabled or disabled.
One long-haired git at your service...
Eric Ladner
Trusted Contributor

Re: rcp to localhost

Also check /etc/hosts.allow and /etc/hosts.deny.

You will probably want to add this:

ALL: localhost
ALL: 127.0.0.1

to your /etc/hosts.allow file. By default, most stuff is denied, I believe.
matt_43
New Member

Re: rcp to localhost

You guys rock! That did it. Thanks to everyone for the help.

Its hard to find good help online. Thanks again.

Matt
Ron Kinner
Honored Contributor

Re: rcp to localhost

Matt,

You need to give the people who helped you some points. Especially if you ever need help again. We can look at your name and see if you give points or not and a lot of people who might know the answer will just skip on to the next post rather than waste time replying. It may seem silly but the recognition you get from earning points really motivates you to provide the correct answer.

Ron
matt_43
New Member

Re: rcp to localhost

Points I didn't know anything about that. Consider it done.