i'm working on a little automation with python about collecting some data related to Splunk indexes. So i though using paramiko to login in one each of those indexer instances and get the info. The thing is when i send a command using
myShell = ssh.invoke_shell()
myShell.send('sudo su\n')
time.sleep(1)
print(myShell.recv(2048))
i get a result like:
b'Last login: Fri Jun 7 15:56:07 2019 from MiIpAddress\r\r\n\x1b[0;39m[\x1b[0;31m15:56:55\x1b[0;39m][\x1b[1;33muser\x1b[1;34m@\x1b[1;33mhost\x1b[0;39m][\x1b[1;36m/home/user\x1b[0;39m]\x1b[0;39m $
Why this is happening and how can i solve it?
BTW: using pycharm IDE from Mac
Thanks!