I'm new to Linux, so I may be a bit unfamiliar with the terminologies used here, but what I'm trying to do now is from a Windows PC, I would use plink to ssh into a Linux server and use
sudo to run as another user to copy a file from a remote location to local.
from a Windows machine A:
plink testadmin@linuxserverB.com "sudo -u user_a python /tools/copyfile.py remoteserverC.com:/a/b/c/filetocopy.txt /local/targetfile.txt"
- where both linuxserverB and remoteserverC is Linux
- python script would accept 2 param argument and calls scp to copy, first is source and next is destination to copy
I would get
Disconnected: Protocol error (Too many authentication failures for user_a). Child process (ssh) exited with code 78)
A few things I noticed:
If I use plink to do the same call but source and target changed to only copy files within
/localTo ‘/local/‘,(linuxserverB ) there will be no issues. It only happens if I try to access a file from remoteserverC.com like the original example.
I tried using the same command as ssh instead of plink on another Linux machine (Linux D), and doing a verbose dump, I see that I would get almost the same error:
X11 connection uses different authentication protocol. X11 connection rejected because of wrong authentication. .. Unable to open display linuxserverB.com:123.0 Disconnected. Protocol error (Too many authentication failures for user_a)
- So I thought it may be due to X11 forwarding issues, although I'm not too familiar with this concept. Basically I tried using
plinkand would get:
Putty X11 proxy: wrong authorisation protocol attemptedUnable to open display linuxserverB.com:123.0 ... Disconnected: Protocol error (Too many authentication failures for user_a)
I tried using
xauthto add the displays on both remoteserverC.com and linuxserverB.com so that both remoteserverC.com and linuxserverB.com contains each other's display id but the problem still persists.
I also tried installing XMing on the Windows machine A, and was able to do a plink of
So I'm not too sure what is wrong. Is there any other thing that I can try? Is the issue due to X11 forwarding display location or due to