Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 11-30-2010, 01:19 AM   #1
LQ Newbie
Registered: Nov 2009
Posts: 3

Rep: Reputation: 0
rcp connection refused

Dear friends,

I can use rcp commands by
/usr/bin/rcp test.txt linux181:/test/test.txt

But when i use,
"rcp test.txt linux181:/test/test.txt"
It show the following error,

connect to address port 544: Connection refused
Trying krb4 rcp...
connect to address port 544: Connection refused
trying normal rcp (/usr/bin/rcp)
Permission denied.

connect to address port 544: Connection refused
Trying krb4 rcp...
connect to address port 544: Connection refused
trying normal rcp (/usr/bin/rcp)
No route to host


[root@linux54 ~]# cat /etc/xinetd.d/rsh
# default: on
# description: The rshd server is the server for the rcmd(3) routine and, \
# consequently, for the rsh(1) program. The server provides \
# remote execution facilities with authentication based on \
# privileged port numbers from trusted hosts.
service shell
socket_type = stream
wait = no
user = root
log_on_success += USERID
log_on_failure += USERID
server = /usr/sbin/in.rshd
disable = no
[root@linux54 ~]# cat /root/.rhosts linux181 linux54

No firewall on both m/c.

Please help tme to solve this issue.

Last edited by thiyagarajancs; 11-30-2010 at 01:21 AM.
Old 11-30-2010, 07:14 AM   #2
LQ Newbie
Registered: Jan 2010
Location: Belgium
Distribution: Debian
Posts: 17

Rep: Reputation: 0
Aside from rcp being very unsafe (because everything is being sent in cleartext over the network) and that you should use ssh or scp instead, maybe the following thread offers some useful advice:

I think in particular this part, because you seem to have put your machines hostname after the ip-address in .rhosts:

Originally Posted by beadyallen View Post
Alright, your problem is most likely a mapping of usernames. I'm guessing that on the remote machines, you've got a .rhosts file containing a list of valid ip addresses. This will probably work fine for the 'root' and 'oracle' accounts, since these will exist on both machines. However, it's likely that your local username isn't valid on the remote machines. To fix it, you can add a line to the .rhosts file. For instance, if you want user 'geoff' (which is valid on your local machine, with ip address to be able to copy things as the 'oracle' user on a remote machine, add the following to the .rhosts in the remote oracle user's home directory:
Code: geoff
However, as I hinted at before, DON'T USE RCP/RSH/RLOGIN. Please. Especially not across the internet. Change to using ssh/scp instead. It's much more secure.
Old 12-21-2010, 11:12 AM   #3
LQ Newbie
Registered: Oct 2009
Location: Aberystwyth
Distribution: Redhat 5
Posts: 21

Rep: Reputation: 0
Beadyallens response was exactly what was the problem with my issue.

My scenario....
i have that contained a file called /transfers/TestA.
I also have where i wanted to copy the file to as user bob.
A user called bob needed to log onto ServerB and copy the TestA file from ServerA.

To get this to work....
On ServerA, I had to create a .rhosts file in the home directory for bob (/home/bob/.rhosts) and add the below line.... bob
This line allows bob on ServerB to access and copy files from ServerA

Then I logged onto ServerB as bob and ran the rcp command as below:-

rcp ServerA:/transfers/TestA /home/bob/

The main problem i had which had me going round in circles was that i never had the correct hostname of ServerA in the .rhosts file.
This needs to be input as your server resolves it.
i.e. I originally thought that because in my hosts file i had the nickname as ServerA it would figure it out, so i had...
ServerA bob

After amending this to the below it worked fine. bob

Hope this helps someone.


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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
trying normal rcp (/usr/bin/rcp) Permission denied. Martin Peter Clarke Linux - Server 5 12-21-2010 10:42 AM
vsftpd not working: Connection attempt failed with "ECONNREFUSED - Connection refused davidlu766 Linux - Server 7 05-03-2010 08:34 PM
rsync ,rcp not working-Connection refused! jimmyjiang Linux - Networking 2 09-17-2008 04:34 AM
eth0 going down (connection reset by peer, then connection refused) Astarath Slackware 1 09-05-2007 05:14 AM
rsh / rcp connection refused DotHQ Red Hat 3 09-07-2006 08:45 AM

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

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