Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

vipul

Re: How to sudo su - newuser in C#

Hi Martin,

I added below code after instantiating sessionOptions and sudo su - newuser worked after that.
sessionOptions.AddRawSettings("Shell", "sudo%20su%20-%20newusername");
sessionOptions.AddRawSettings("RemoteDirectory", "/desired_path_accessible_by_newuser");

Thank you for the help,
Vips
vipul

How to sudo su - newuser in C#

Hi All,

I am logging in with my UserID - vipul123. My account has necessary sudo privilegs and I can sudo su - newuser using GUI of WinSCP.

I am successfully able to Open the connection and access the SFTP in C# code using my userID - vipul123.
Now, I want to do sudo su - newuser in C# code after I login with my UserID - vipul123.

How can I do the same?
Please help me.

Thanks in advance,
Vips