Switching users using WinSCP between different accounts

倾然丶 夕夏残阳落幕 提交于 2019-12-01 02:59:37

问题


Is there way to switch between user accounts using WinSCP?

When I am using PuTTY, I can use su command to switch users between different accounts.

For an example:

kitis@localhost$
kitis@localhost$ su abc
abc@localhost$

In the same way, when I am using WinSCP, is there a way for me to switch users while I have logged in to a server?


回答1:


No, it is impossible. When you want to switch user using SCP (WinSCP in your case) your need to relogin. You can't run any commands in SCP-session, just manage files; fnd SCP-protocol itself supports no mechanisms to change current users' id. You must use SSH if you want to have a possibility to change a user in a session.




回答2:


There is a FAQ for this question on WinSCP site:
How do I change user after login (e.g. su root)?

You need to specify the sudo command in WinSCP session settings, as custom shell (if you are using SCP) or use sudo in custom SFTP server startup command (if you are using SFTP).

Though there are some limitations, notably that you need to configure sudo not to require a password.

See the link for details.



来源:https://stackoverflow.com/questions/11464824/switching-users-using-winscp-between-different-accounts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!