Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 25

Thread: How do I recreate the magic ubuntu does with ssh keys?

  1. #11
    Join Date
    Mar 2010
    Location
    Los Angeles, CA
    Beans
    230
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How do I recreate the magic ubuntu does with ssh keys?

    The above script won't help. The issue is that the key is passphrase protected.
    Postfix problems? Come find me in #postfix on the freenode IRC network.

  2. #12
    Join Date
    Jun 2006
    Beans
    161
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: How do I recreate the magic ubuntu does with ssh keys?

    I'm 99% sure the key is not passphrase protected. Like I said, I can run the script from the terminal and it works fine without asking for any passwords to be entered.

  3. #13
    Join Date
    Sep 2008
    Location
    Michigan, USA
    Beans
    193
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: How do I recreate the magic ubuntu does with ssh keys?

    Ok then, try my test script suggestion. I think something is messed up in the environment that cron is attempting to run the script in.

  4. #14
    Join Date
    Mar 2010
    Location
    Los Angeles, CA
    Beans
    230
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How do I recreate the magic ubuntu does with ssh keys?

    I've said this. Alternately he can hook the ssh-agent process.
    Postfix problems? Come find me in #postfix on the freenode IRC network.

  5. #15
    Join Date
    Jun 2006
    Beans
    161
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: How do I recreate the magic ubuntu does with ssh keys?

    I added "cat /home/chris/.ssh/id_rsa" at the top, and it prints out this:

    Code:
    ~$ cat err.log
    ~ ~
    -----BEGIN RSA PRIVATE KEY-----
    Proc-Type: 4,ENCRYPTED
    DEK-Info: DES-EDE3-CBC,A7F6B957A1A54BCE
    
    ZYS/WQG2DATBjle0qOq+8HbEQV8geH/Q3SEOyVOmZ65qqtq2ZaADYqd3x5t1pJFT
    [snip]
    bOOvwzDSrV36k8zORG8tf7dUWK6LEUd2aQ0CIuzbHf5XyQh2M0L3zw==
    -----END RSA PRIVATE KEY-----
    Permission denied, please try again.
    
    Permission denied, please try again.
    
    Permission denied (publickey,password).
    
    after ssh
    0.dump: No such file or directory
    after scp
    ~

  6. #16
    Join Date
    Sep 2008
    Location
    Michigan, USA
    Beans
    193
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: How do I recreate the magic ubuntu does with ssh keys?

    Ok, is the user the same on the remote machine? Try replacing "server" with "user@server". Where the user is that on the remote machine.

  7. #17
    Join Date
    Jun 2006
    Beans
    161
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: How do I recreate the magic ubuntu does with ssh keys?

    Quote Originally Posted by KiLaHuRtZ View Post
    Ok, is the user the same on the remote machine? Try replacing "server" with "user@server". Where the user is that on the remote machine.
    "server" is from ~/.ssh/config, changing to user@domain.com has the same result.

    echo "$USER"
    echo "$HOME"
    echo "$SHELL"
    echo "$PATH"

    returns this:


    /home/chris
    /bin/bash
    /usr/bin:/bin

    $USER seems to be blank. I tried manually setting it to 'chris', but it had no effect.

  8. #18
    Join Date
    Mar 2010
    Location
    Los Angeles, CA
    Beans
    230
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How do I recreate the magic ubuntu does with ssh keys?

    I suspect a passphrase. The creds to unlock it are stored with your login keystore.
    Postfix problems? Come find me in #postfix on the freenode IRC network.

  9. #19
    Join Date
    Jun 2006
    Beans
    161
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: How do I recreate the magic ubuntu does with ssh keys?

    Quote Originally Posted by KB1JWQ View Post
    I suspect a passphrase. The creds to unlock it are stored with your login keystore.
    do you know of a foolproof way to verify this?

  10. #20
    Join Date
    Sep 2008
    Location
    Michigan, USA
    Beans
    193
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: How do I recreate the magic ubuntu does with ssh keys?

    On the remote machine, run this. See who cron is attempting to login as.

    Code:
    sudo cat /var/log/auth.log | grep sshd | grep Failed

Page 2 of 3 FirstFirst 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •