Когда я подключаюсь к Linux с помощью ssh, приглашение bash centos-1:~#
.
Но когда я подключаюсь к Linux с помощью pexpect spawn, приглашение bash \x1b]0;root@centos-1:~\x07centos-1:~# \r\n
.Что является причиной этого изменения и как мне избавиться от этой проблемы?
Пожалуйста, найдите различия ниже.
>>> import pexpect
>>> child = pexpect.spawn("/bin/ssh",["root@172.23.63.10"]);
>>> child.readline();
'#############################################################\r\n'
>>> child.readline();
'# #\r\n'
>>> child.readline();
'# This system is restricted to authorized users only. #\r\n'
>>> child.readline();
'# Unauthorized access or access attempts to this system #\r\n'
>>> child.readline();
'# or services are prohibited. All user activity is logged. #\r\n'
>>> child.readline();
'# Evidence of unauthorized use collected during monitoring #\r\n'
>>> child.readline();
'# may be provided to appropriate personnel for #\r\n'
>>> child.readline();
'# administrative, criminal or other adverse action. #\r\n'
>>> child.readline();
'# #\r\n'
>>> child.readline();
'#############################################################\r\n'
>>> child.readline();
'X11 forwarding request failed on channel 0\r\n'
>>> child.readline();
'Last login: Wed Jan 30 08:48:32 2019 from 10.70.52.187\r\r\n'
>>> child.readline();
'#############################################################\r\n'
>>> child.sendline("");
1
>>> child.readline();
'\x1b]0;root@centos-1:~\x07\x1b[?1034hcentos-1:~# \r\n'
>>> child.sendline("");
1
>>> child.readline();
'\x1b]0;root@centos-1:~\x07centos-1:~# \r\n'
>>> child.sendline("");
1
>>> child.readline();
'\x1b]0;root@centos-1:~\x07centos-1:~# \r\n'
[greddy] # ssh root@172.23.63.10
#############################################################
# #
# This system is restricted to authorized users only. #
# Unauthorized access or access attempts to this system #
# or services are prohibited. All user activity is logged. #
# Evidence of unauthorized use collected during monitoring #
# may be provided to appropriate personnel for #
# administrative, criminal or other adverse action. #
# #
#############################################################
X11 forwarding request failed on channel 0
Last login: Wed Jan 30 08:51:17 2019 from 10.70.52.187
#############################################################
centos-1:~#
centos-1:~#