SFTP plugin and sudo to root ?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
Gernij
Junior Member
Junior Member
Posts: 7
Joined: 2013-01-26, 17:34 UTC

SFTP plugin and sudo to root ?

Post by *Gernij »

Is it possible to use the sftp plugin for connection with a linux system and to do a sudo command to get root privileges after login ?

I managed to do this with WINSCP by using scp protocol and not sftp and supply the sudo command in a field in the preferences. I tried this with the sftp plugin and checked te scp boxes in the settings and issue the sudo command on the commandline of TC. But no luck.

Does anyone know if this is possible ?

Greetings
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50532
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: SFTP plugin and sudo to root ?

Post by *ghisler(Author) »

No, unfortunately the used SSH library does not allow to open an SFTP session via root shell.
Author of Total Commander
https://www.ghisler.com
JOUBE
Power Member
Power Member
Posts: 1664
Joined: 2004-07-08, 08:58 UTC

Re: SFTP plugin and sudo to root ?

Post by *JOUBE »

The SFTP plugin opens a connection with root without any problems and the directories are then read without any problems and files are copied back and forth without any problems as root.

It may be that the noninteractive shell cannot (continue to) run as root, I haven't tested that yet. Above all, because the noninteractive shell is terminated after each command (command from within the Tc command line).

But it is perfectly possible to run commands with sudo _within_ scripts running on the remote system.

It should be noted, however, that interactive input is not possible. The user who calls sudo in the script must therefore be entered in sudoer in such a way that NOPASSWD is specified for him.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50532
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: SFTP plugin and sudo to root ?

Post by *ghisler(Author) »

What I mean is that you can't login as normal user (SSH connection) and then try to access files via sudo of the SFTP process. Remote login with user root is often prohibited.
Author of Total Commander
https://www.ghisler.com
JOUBE
Power Member
Power Member
Posts: 1664
Joined: 2004-07-08, 08:58 UTC

Re: SFTP plugin and sudo to root ?

Post by *JOUBE »

That's right.
Gernij
Junior Member
Junior Member
Posts: 7
Joined: 2013-01-26, 17:34 UTC

Re: SFTP plugin and sudo to root ?

Post by *Gernij »

Thank you both for clarifying. I didn't understand the second answer but now I do.
Post Reply