access to another server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • coaxfiber
    New Member
    • Mar 2007
    • 60

    access to another server

    How can i run a command to another server?

    Example:

    from

    rc1: /m/home/coax

    then i want to command "ls -ltr" to another server (different IP address) which is the

    rc2:/m/home/coax/


    Can I use the RCP?


    Thanks.

    -coax
  • arne
    Recognized Expert Contributor
    • Oct 2006
    • 315

    #2
    Originally posted by coaxfiber
    How can i run a command to another server?

    Example:

    from

    rc1: /m/home/coax

    then i want to command "ls -ltr" to another server (different IP address) which is the

    rc2:/m/home/coax/


    Can I use the RCP?


    Thanks.

    -coax
    Try ssh:
    Code:
    ssh coax@rc2 'ls -lrt /m/home/coax/'
    assuming your user name is coax and the remote machine's name is rc2.

    HTH,
    arne

    Comment

    • coaxfiber
      New Member
      • Mar 2007
      • 60

      #3
      Sir,

      How about without asking for a password?

      Thanks Again.

      Comment

      • arne
        Recognized Expert Contributor
        • Oct 2006
        • 315

        #4
        Originally posted by coaxfiber
        Sir,

        How about without asking for a password?

        Thanks Again.
        Have a look at Public-Key Authentication for SSH (just google for 'ssh no password' and you will find a lot of tutorials how to set that up).

        If the machines is trustworthy, you can also use rsh instead of ssh, google for 'rsh no password'.

        I would recommend to have a look at the SSH solution, however.

        HTH,
        arne

        Comment

        • coaxfiber
          New Member
          • Mar 2007
          • 60

          #5
          Sir,
          What should I do if the authorized_keys is not present in the folder .ssh2?

          We're using 4 servers. But only in one server this 'authorized_key s' is existed.

          Thanks.

          Comment

          • arne
            Recognized Expert Contributor
            • Oct 2006
            • 315

            #6
            Originally posted by coaxfiber
            Sir,
            What should I do if the authorized_keys is not present in the folder .ssh2?

            We're using 4 servers. But only in one server this 'authorized_key s' is existed.

            Thanks.
            You can simply create it.

            arne

            Comment

            • coaxfiber
              New Member
              • Mar 2007
              • 60

              #7
              Do you mean I can simply 'touch authorized_keys '.. and then that's it?

              After I created the file I can just append the id_rsa.pub?


              Thanks Very Much.

              Comment

              • arne
                Recognized Expert Contributor
                • Oct 2006
                • 315

                #8
                Originally posted by coaxfiber
                Do you mean I can simply 'touch authorized_keys '.. and then that's it?

                After I created the file I can just append the id_rsa.pub?


                Thanks Very Much.
                Yes, that should do it.

                You may want to try that with one of your servers first before changing all of them :-)

                arne

                Comment

                Working...