0

I'm trying to SSH into my VM and did perform a git pull

  • the SSH seems to be working fine
  • the git pull seem to be executed
  • but when I provide password, it doesn't seem to take it
  • Am I missing something ?

I have

import paramiko
import time
import sys
import os
import pdb

# Note
# sudo pip install --user paramiko
ip = "111.111.111.111"
un = "root"
pw = "abc"

def ssh_con (ip, un, pw):
    global ssh
    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
    ssh.connect(ip, username=un, password=pw)

def cmd_io (command):
    global ssh_cmd
    ssh_cmd.send("%s \n" %command)
    time.sleep(1)
    output = ssh_cmd.recv(10000).decode("utf-8")
    print (output)

ssh_con(ip,un,pw)
ssh_cmd = ssh.invoke_shell()
print ("SSH CONNECTION ESTABLISHED TO %s" % ip)
cmd_io("git pull")
time.sleep(2)
cmd_io(pw)

I kept getting

git pull 
Enter passphrase for key '/root/.ssh/id_rsa': 

Enter passphrase for key '/root/.ssh/id_rsa': 
1

1 Answer 1

1

It looks like your SSH Rsa Key pair has been setup up with a pass phrase for root on 111.111.111.111. You can recreate the ssh rsa key with:

ssh-keygen -t rsa

and just leave pass phrase blank.

Sign up to request clarification or add additional context in comments.

1 Comment

Semantics, but the pass phrase is not for 111.111.111.111, but for the private key on the local host. And if you recreate the ssh keys, the remote systems will need to know the new public key.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.