i checked paramiko, in agent.py
self.conn = None 59 self.keys = () 60 if ('SSH_AUTH_SOCK' in os.environ) and (sys.platform != 'win32'): 61 conn = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) 62 try: 63 conn.connect(os.environ['SSH_AUTH_SOCK']) 64 except: 65 # probably a dangling env var: the ssh agent is gone 66 return 67 self.conn = conn 68 elif sys.platform == 'win32': 69 import win_pageant 70 if win_pageant.can_talk_to_agent(): 71 self.conn = win_pageant.PageantConnection() 72 else: 73 return
it will use SSH_AUTH_SOCK envrionment variable when through auth_publickey SSH_AUTH_SOCK=/tmp/keyring-2bBsGe/ssh
for root user, has no such envrionment variable, so it is ok. if i add, it will fail too.
i checked paramiko, in agent.py
self.conn = None socket( socket. AF_UNIX, socket.SOCK_STREAM) os.environ[ 'SSH_AUTH_ SOCK']) can_talk_ to_agent( ): PageantConnecti on()
59 self.keys = ()
60 if ('SSH_AUTH_SOCK' in os.environ) and (sys.platform != 'win32'):
61 conn = socket.
62 try:
63 conn.connect(
64 except:
65 # probably a dangling env var: the ssh agent is gone
66 return
67 self.conn = conn
68 elif sys.platform == 'win32':
69 import win_pageant
70 if win_pageant.
71 self.conn = win_pageant.
72 else:
73 return
it will use SSH_AUTH_SOCK envrionment variable when through auth_publickey SOCK=/tmp/ keyring- 2bBsGe/ ssh
SSH_AUTH_
for root user, has no such envrionment variable, so it is ok.
if i add, it will fail too.