ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    CentOS rsync between servers using keyfile to pass credentials

    IT Discussion
    rsync centos7 crontab
    9
    44
    4.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DustinB3403D
      DustinB3403
      last edited by

      Which when I provide the password, the rsync operates without issue.

      1 Reply Last reply Reply Quote 0
      • travisdh1T
        travisdh1 @DustinB3403
        last edited by

        @DustinB3403 said in CentOS rsync between servers using keyfile to pass credentials:

        Using the rsync command above, I'm still prompted for the admin password of the target server.

        Which the goal is to solely use the public and private keys for this.

        If you enter a passphrase during the keygen sequence you will need to enter a password to enable use of the ssh key. So, did you enter a password in the questions asked during the keygen?

        travisdh1T 1 Reply Last reply Reply Quote 1
        • travisdh1T
          travisdh1 @travisdh1
          last edited by

          @travisdh1 said in CentOS rsync between servers using keyfile to pass credentials:

          @DustinB3403 said in CentOS rsync between servers using keyfile to pass credentials:

          Using the rsync command above, I'm still prompted for the admin password of the target server.

          Which the goal is to solely use the public and private keys for this.

          If you enter a passphrase during the keygen sequence you will need to enter a password to enable use of the ssh key. So, did you enter a password in the questions asked during the keygen?

          I know it's so very counter intuitive at first, but enabling key only authentication means you can't enter anything at that point, just enter through those two questions.

          JaredBuschJ 1 Reply Last reply Reply Quote 0
          • stacksofplatesS
            stacksofplates
            last edited by

            So to reiterate, here's what I'd do:

            If you don't need elevated privileges use a regular account.

            ssh-keygen -t rsa -b 4096
            

            Just enter through the prompts

            Then:

            ssh-copy-id -i user@remotehost
            

            Then do the same for the other machine.

            What's your output of ls -lZ in the /home/user/.ssh/ directory?

            $20 says if you just did a touch authorized_keys it's going to have the wrong permissions/context.

            JaredBuschJ 1 Reply Last reply Reply Quote 1
            • JaredBuschJ
              JaredBusch @travisdh1
              last edited by

              @travisdh1 said in CentOS rsync between servers using keyfile to pass credentials:

              @travisdh1 said in CentOS rsync between servers using keyfile to pass credentials:

              @DustinB3403 said in CentOS rsync between servers using keyfile to pass credentials:

              Using the rsync command above, I'm still prompted for the admin password of the target server.

              Which the goal is to solely use the public and private keys for this.

              If you enter a passphrase during the keygen sequence you will need to enter a password to enable use of the ssh key. So, did you enter a password in the questions asked during the keygen?

              I know it's so very counter intuitive at first, but enabling key only authentication means you can't enter anything at that point, just enter through those two questions.

              It is not counter intuitive at all. it is a second form of authentication. Key + Password. He just messed up and set it up that way. He needs to redo the key without a password.

              1 Reply Last reply Reply Quote 2
              • JaredBuschJ
                JaredBusch @stacksofplates
                last edited by

                @stacksofplates said in CentOS rsync between servers using keyfile to pass credentials:

                So to reiterate, here's what I'd do:

                If you don't need elevated privileges use a regular account.

                ssh-keygen -t rsa -b 4096
                

                Just enter through the prompts

                Then:

                ssh-copy-id -i user@remotehost
                

                Then do the same for the other machine.

                What's your output of ls -lZ in the /home/user/.ssh/ directory?

                $20 says if you just did a touch authorized_keys it's going to have the wrong permissions/context.

                No, my $20 is on he did not "just enter through the prompts"

                stacksofplatesS DustinB3403D 2 Replies Last reply Reply Quote 3
                • stacksofplatesS
                  stacksofplates @JaredBusch
                  last edited by

                  @JaredBusch said in CentOS rsync between servers using keyfile to pass credentials:

                  @stacksofplates said in CentOS rsync between servers using keyfile to pass credentials:

                  So to reiterate, here's what I'd do:

                  If you don't need elevated privileges use a regular account.

                  ssh-keygen -t rsa -b 4096
                  

                  Just enter through the prompts

                  Then:

                  ssh-copy-id -i user@remotehost
                  

                  Then do the same for the other machine.

                  What's your output of ls -lZ in the /home/user/.ssh/ directory?

                  $20 says if you just did a touch authorized_keys it's going to have the wrong permissions/context.

                  No, my $20 is on he did not "just enter through the prompts"

                  I did say "if" he manually created that file. My initial $20 is with yours.

                  1 Reply Last reply Reply Quote 1
                  • DustinB3403D
                    DustinB3403 @JaredBusch
                    last edited by DustinB3403

                    @JaredBusch said in CentOS rsync between servers using keyfile to pass credentials:

                    @stacksofplates said in CentOS rsync between servers using keyfile to pass credentials:

                    So to reiterate, here's what I'd do:

                    If you don't need elevated privileges use a regular account.

                    ssh-keygen -t rsa -b 4096
                    

                    Just enter through the prompts

                    Then:

                    ssh-copy-id -i user@remotehost
                    

                    Then do the same for the other machine.

                    What's your output of ls -lZ in the /home/user/.ssh/ directory?

                    $20 says if you just did a touch authorized_keys it's going to have the wrong permissions/context.

                    No, my $20 is on he did not "just enter through the prompts"

                    I did not (just enter through), doing it now.

                    1 Reply Last reply Reply Quote 0
                    • DustinB3403D
                      DustinB3403
                      last edited by

                      Wow, so simple, but still when attempting the rsync operation, I'm being prompted for the remote server root password.

                      Any ideas on that?

                      1 Reply Last reply Reply Quote 0
                      • DustinB3403D
                        DustinB3403
                        last edited by

                        Nevermind, seems to work when I don't bother telling the system to use the authorized key.

                        travisdh1T 1 Reply Last reply Reply Quote 0
                        • travisdh1T
                          travisdh1 @DustinB3403
                          last edited by

                          @DustinB3403 said in CentOS rsync between servers using keyfile to pass credentials:

                          Nevermind, seems to work when I don't bother telling the system to use the authorized key.

                          That IS kinda the idea. ssh just handles that for you, even when called from another program like rsync.

                          1 Reply Last reply Reply Quote 0
                          • 1
                          • 2
                          • 3
                          • 3 / 3
                          • First post
                            Last post