I use the pexpect module to login a ssh server and then mkdir a directory:
from pexpect import pxssh
s = pxssh.pxssh()
s.login(server='43.24.24.29', username='root', password='my_password')
s.send('mkdir aaa')
s.logout()
it works, but I find, in the server, there created aaaexit directory, there is not aaa directory:
[root@localhost ~]# ls
aaaexit anaconda-ks.cfg
I know there maybe the s.logout() affected it, but how to resolve this problem.