When I run the following code in eclipse, getPass returns a string suffixed with a carriage at the end.
However, when I run the same code in command prompt it runs without any problem.
import paramiko
import getpass
userPwd = getpass.getpass()
print ('You have entered ',userPwd)
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('ese.rnd.sanl.se', username='abc',
password=userPwd)
stdin,stdout,stderr=ssh.exec_command("ls")
data1=stdout.read().splitlines();
for line in data1:
print (line)
Output (Eclipse):
Warning: Password input may be echoed.
Password: Mypassword@123
('You have entered ', 'Mypassword@123\r')
Output (Command Prompt):
Warning: Password input may be echoed.
Password: Mypassword@123
('You have entered ', 'Mypassword@123')
Can anyone explain this ambiguity?
Thanks!!