[英]Python PXSSH GUI spawn on login failure
I can't stop the GUI from spawning when a login failure occurs. 登录失败时,我无法阻止GUI生成。
simple example that fails and spawns a GUI. 失败并生成GUI的简单示例。
>>> import pxssh
>>>
>>> ssh = pxssh.pxssh()
>>> ssh.force_password = True
>>> ssh.login('127.0.0.1', 'root', 'falsePW')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/pxssh.py", line 226, in login
raise ExceptionPxssh ('password refused')
pxssh.ExceptionPxssh: password refused
>>>
I have tried disabling x11 forwarding in these files, nothing changed. 我尝试在这些文件中禁用x11转发,没有任何变化。
/etc/ssh/ssh_config
/etc/ssh/sshd_config
/etc/ssh/ssh_config
/etc/ssh/sshd_config
I have also tried going into the pxssh module and where it sets the ssh options I set the flag -x Disables X11 forwarding.
我还尝试进入pxssh模块及其设置ssh选项的位置,我设置了标志
-x Disables X11 forwarding.
still no change. 仍然没有变化。
I am running cinnamon on Linux Mint, the pxssh docs said some x display managers will start up a GUI. 我在Linux Mint上运行肉桂,pxssh文档说一些x显示管理器将启动GUI。 To solve this is says to remove all ssh-agents, which I have also tried to no avail.
要解决这个问题,据说要删除所有的ssh-agent,我也曾尝试无济于事。
After tampering with the pxssh.py
module I found a solution thats very simple. 篡改
pxssh.py
模块后,我发现了一个非常简单的解决方案。
inside the pxssh.py module: sudo nano /usr/lib/python2.7/dist-packages/pxssh.py
在pxssh.py模块内部:
sudo nano /usr/lib/python2.7/dist-packages/pxssh.py
Location Update: sudo nano /usr/lib/python2.7/dist-packages/pexpect/pxssh.py
位置更新:
sudo nano /usr/lib/python2.7/dist-packages/pexpect/pxssh.py
class pxssh(spawn)
def _init__( parameters )
# change these variables to shown value
self.force_password = True
self.auto_prompt_reset = False
# next under the login function
def login( parameters )
# set the -x flag: disables x11 forwarding (removing GUI)
ssh_options = '-q -x'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.