Solved

Using RCP on two Sun servers.

Posted on 2004-10-26
657 Views
Last Modified: 2013-12-27
Hi,

Can someone assist me with what I need to configure and two Sun servers to allow me to remotely copy (rcp) files from one Sun server to another?

Thank you.
0
Question by:gsalcedo
    24 Comments
     
    LVL 51

    Expert Comment

    by:ahoffmann
    rsh/rcp are installed and configured by default on Sun, usually.
    What's your problem actually.

    BTW, I'd recommend to use ssh/scp instead of rsh/rcp for security reasons
    0
     
    LVL 2

    Expert Comment

    by:Matt_Avery
    You need to configure the "/etc/hosts.equiv" file (for systemwide configuration) or "$HOME/.rhosts" file (for per-user configuration) on the remote host.

    The simplest setup would have the "/etc/hosts.equiv" on "server1" containing a single line that says "server2" and vice versa (where "server1" and "server2" are the hostnames of your two machines).

    Note that things begin to get complicated if you don't have the same usernames on both machines. See "man hosts.equiv" for more details.

    I'd agree with ahoffman that the "scp" utility that comes bundled with SSH is a more secure option. Only use "rcp" on a completely trusted network.

     
    0
     
    LVL 48

    Expert Comment

    by:Tintin
    And depending on your purposes, rsync may well be a more suitable tool.
    0
     
    LVL 51

    Expert Comment

    by:ahoffmann
    > .. rsync may well be a more suitable tool
    .. which is on top of rcp/scp, usually ;-)
    0
     

    Author Comment

    by:gsalcedo
    Hi Matt,

    The environment that I am working in is a fully secured environment in which none of the servers are allowed to go to non-secured network environment.  I am trying to use rcp and have edited the .rhosts file, but I can not remotely copy any files from server 1 to server 2 or visa versa.  In server 1's .rhosts file, I have indicated server 2's FQDN and did the same for server 2's .rhosts file with server 1's FQDN.  Is there anything else that I have configure or edit?

    Thank you in advance.
    0
     
    LVL 51

    Expert Comment

    by:ahoffmann
    what does ping and nslookup return on either server when querying the other one?
    0
     

    Author Comment

    by:gsalcedo
    Hi ahoffmann,

    Both servers are able to run nslookup on each other without any difference.  As for ping, I am able to ping each other, but the only difference is server 1 would just give me a host name as being alive (server 2 is alive).  When I would ping server 1 via server 2, it would give me FQDN is alive (server 1.domain_name.com is alive).


    Thank you for your help.
    0
     
    LVL 48

    Expert Comment

    by:Tintin
    And that's probably your problem.

    Your host entries in the .rhosts file need to match the name of what the machine thinks it is.  A lot of people specify the hostname and the FQDN to be safe.
    0
     
    LVL 51

    Expert Comment

    by:ahoffmann
    Tintin said what I had in mind ;-)
    simply add both entries in your .rhosts file
       server1
       FQDN-of-server1
    same for server2
    In long term you better setup a proper DNS and /etc/hosts, which is the basics for " is a fully secured environment i", somehow ...
    0
     

    Author Comment

    by:gsalcedo
    Thank you for your advices.  I will give it a try.  
    0
     

    Author Comment

    by:gsalcedo
    Hi Tintin and ahoffmann,

    I have edited and checked the .rhosts and the /etc/hosts files on both servers and ran a rcp test, but it still does not work.  I have added a host name and FQDN on the .rhosts file of both servers and added the IP, FQDN and host name on the /etc/hosts file of both of the servers.  Server 1 would have Server 2 info and Server 2 would have Server 1 info.  I have checked the DNS server and their entries have been indicated in the db.*** and the reverse lookup.  There must be something that I am missing.  The error that I would receive whenever I would run a rcp test from Server 2 to Server 1 is "Server 1: Connection refused."  I feel that I am missing something on the servers' configurations.  Do you happen to have any clue on what it might be?

    Thank you.
    0
     
    LVL 51

    Expert Comment

    by:ahoffmann
    > /etc/hosts  ??
    that's out of question here, you need to adapt /etc/hosts.equiv and/or (depending on your configuration) ~/.rhosts
    0
     

    Author Comment

    by:gsalcedo
    Hi ahoffmann,

    Previously, I was using two files (hosts.allow and hosts.deny) to represent the hosts.equiv file.  I have created the hosts.equiv file on both of the serves (Server 1 and Server 2) and written the appropriate line for that file ( +server 2.domain.com on Server 1 and +server 1.domain.com on Server 2).  After checking the .rhosts and hosts.equiv files on both of the servers, I have tried to run a rcp command on Server 2 (rcp server 1:/opt/file /tmp/) and it still would give out a error message (server 1: Connection refused).
    0
     
    LVL 51

    Expert Comment

    by:ahoffmann
    please post your hosts.* files
       cat /etc/hosts.* ~/.rhosts
    0
     

    Author Comment

    by:gsalcedo
    Hi ahoffman,

    Since the environment that I work in is a secure environment, I am not allowed to hand that information out.  I can give you an example of what is contained in the /etc/hosts.equiv and .rhosts files for the two servers.

    On Server_1, here is the information that I got from cat /etc/hosts.equiv ~/.rhosts
    +server_2.abc.com    root

    server_2    root


    On Server_2, here is the information that I got from cat /etc/hosts.equiv ~/.rhosts
    +server_1.abc.com    root

    server_1    root

    0
     
    LVL 51

    Expert Comment

    by:ahoffmann
    +server_2.abc.com    root

    AFAIK this is wrong syntax, needs to be:

    server_2.abc.com    root

    Also did you check /etc/default/login, following line should be disabled

    CONSOLE=/dev/console
    0
     

    Author Comment

    by:gsalcedo
    Thank you ahoffmann..  I will look into that.
    0
     

    Author Comment

    by:gsalcedo
    Hi ahoffmann,

    I have commented out (disabled) the line CONSOLE=/dev/console and removed the "+" from the /etc/hosts.equiv of both servers (server_1 and server_2), but I would still receive the message, server_1: Connection refused, on server_2.
    0
     
    LVL 48

    Expert Comment

    by:Tintin
    gsalcedo.

    Given that you are in a "secure" environment, why don't you use ssh (as previously suggested)?  Does your "secure" environment prevent you from using secure protocols?
    0
     

    Author Comment

    by:gsalcedo
    I do use ssh, but what is the command that I have to use to copy files from one server to another?
    0
     

    Author Comment

    by:gsalcedo
    I know that you have mentioned about "scp" and "sftp".  Isn't it software that I have to install that does not come as a default with the Solaris OS?  If I do have to install the scp or sftp, then there is an issue.  One of the server Server_2 is at a remote site that I would have to either ask another administrator to approve the download and installation or go across the country to install it myself.  If scp or sftp does come as a default, what would the process be to configure it to be utilize?

    Thank you.
    0
     
    LVL 48

    Expert Comment

    by:Tintin
    Ahh.  Progress.

    I thought it would be very retrograde step to use something as insecure as rcp in a secure environment.

    If you have ssh, then you will have scp.  ssh comes standard with Solaris >=9

    I guess the issue is if it is installed on the remote site.  If it needs to be installed, wouldn't that be a much better option than using a insecure transfer mechanism?
    0
     
    LVL 51

    Accepted Solution

    by:
    to complete the ssh discussions:
      ssh comes with scp and sftp
     ssh is a replacement of rlogin and rsh, and scp for rcp, both with same syntax as rsh and rcp
    0
     

    Author Comment

    by:gsalcedo
    Hi ahoffmann and Tintin,

    I really appreciate your help.  The reason why I did not want to go through the route of using the scp or sftp is because I did not want to ask someone install the application or go to the offsite location to install it myself.  There is just a lot of political approvals that I have to go through to have a software installed.  Also, I did not know that scp and sftp came with ssh.  When I tried to do a "man" on scp and sftp on my Solaris systems, I would get a "No manual entry" response.  So, I just used the scp command in replacement of rcp and it worked.  Thank you very much.
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
    Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
    Video by: Phil
    This video goes over how to configure and start a jail in FreeBSD.  This video is meant to supplement the following article: http://www.experts-exchange.com/OS/Unix/A_17455-HOWTO-FreeBSD-Jails.html

    857 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now