I want to change PS1 when i ssh another centos
strshell = 'PS1="remote!"'
os.system("ssh -i %s -l%s -p%s %s %s"%(SSH_KEY,SSH_USER,SSH_PORT,des,strshell))
ssh quit automatically. I want to stay in this shell.How to achieve it.
I just change another way to do this
tin = ' sudo -i ; export PS1="Remote! \W :"; exec /bin/bash -i'
os.system("ssh -i%s -l%s -p%s %s -t%s" % (SSH_KEY, SSH_USER, SSH_PORT, des, tin))
but i changed my local machine prompt not the remote one. why?
os.system is a python function
os.system(..ssh..)
process that it launched.pexpect
?