1

I had setup passwordless ssh (keygen) to access my remote workspace from my personal laptop. On the remote server, I do use an account with a password to connect. Setting up public/private key authentication allowed me to connect without having to type this password.

The Python script I am running uses subprocess.Popen() to ssh into this remote workspace again. However, it is not a passwordless ssh during this. I have checked my permissions and have tried to delete and recreate the keys, yet this still happens.

Below is the relevant piece of Python code.

subprocess.Popen(['ssh', machine_addr, 'cd ' + workspace + \ '; python dispynode.py --serve 1 --clean --dest_path_prefix dispytmp_' + str(i)])

  • What do you mean when you say passwordless? The account you are trying to log in is really passwordless? Are you using ip based authentication? Are you using public/private key authentication? – andcoz Jun 14 '18 at 15:23
  • I have clarified what I meant by passwordless. I am using key authentication. – jg925 Jun 14 '18 at 15:25
  • 1
    Is your key passphrase protected? Is the password ssh asks the remote host password or the key passphrase? – andcoz Jun 14 '18 at 15:41
  • Before I set up the keys, I used a password to access the server. – jg925 Jun 14 '18 at 16:05
  • 1
    Are you using ssh-agent on the client to manage the SSH keys? If so, are you executing the Python script in an environment where the SSH_AUTH_SOCK environment variable is available? Are you executing your Python script as yourself or as another user? – Kusalananda Jun 14 '18 at 16:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.