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':