How to add SetEnv in SFTP-settings?
Moderators: Hacker, petermad, Stefan2, white
How to add SetEnv in SFTP-settings?
How to add SetEnv
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: How to add SetEnv in Sftp ?
You can now send commands from a button also to the SFTP plugin.
Function type: send shell command
Command: sh <- MUST always be just sh
Parameters: The actual command. Start with ? to get confirmation dialog, start with * to get result as dialog, ?* for both. You can use all placeholders like %N for the first selected file.
Function type: send shell command
Command: sh <- MUST always be just sh
Parameters: The actual command. Start with ? to get confirmation dialog, start with * to get result as dialog, ?* for both. You can use all placeholders like %N for the first selected file.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: How to add SetEnv in Sftp ?
I mean specifying it on settings, not after connecting.ghisler(Author) wrote: 2023-07-12, 14:34 UTC You can now send commands from a button also to the SFTP plugin.
Function type: send shell command
Command: sh <- MUST always be just sh
Parameters: The actual command. Start with ? to get confirmation dialog, start with * to get result as dialog, ?* for both. You can use all placeholders like %N for the first selected file.
Re: How to add SetEnv in Sftp ?
It would be enough for me as described. But how and where exactly do I enter it?Spz2022 wrote: 2023-07-13, 04:01 UTCI mean specifying it on settings, not after connecting.ghisler(Author) wrote: 2023-07-12, 14:34 UTC You can now send commands from a button also to the SFTP plugin.
Function type: send shell command
Command: sh <- MUST always be just sh
Parameters: The actual command. Start with ? to get confirmation dialog, start with * to get result as dialog, ?* for both. You can use all placeholders like %N for the first selected file.
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: How to add SetEnv in SFTP-settings?
Unfortunately the plugin doesn't allow to send user commands when connecting, sorry.I mean specifying it on settings, not after connecting.
Lower button bar: Press the rightmost button. If it opens a secondary button bar, click on the "+" button. Then enter the details as described above.It would be enough for me as described. But how and where exactly do I enter it?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: How to add SetEnv in SFTP-settings?
This is true, but some ssh needs to be authenticated by
SetEnv.
SetEnv.
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: How to add SetEnv in SFTP-settings?
Can you give me more details, please? SetEnv just sets an environment variable, what does it have to do with authentication? You can't send shell commands before being logged in!
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: How to add SetEnv in SFTP-settings?
like this
ssh -o "SetEnv SECRET=XXX" root@8lgm.segfault.net
ssh -o "SetEnv SECRET=XXX" root@8lgm.segfault.net
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: How to add SetEnv in SFTP-settings?
Sorry, I don't see how this would work before logging in. SSH just creates a remote shell, but you can't send commands until you are fully logged in.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: How to add SetEnv in SFTP-settings?
"ssh -o SetEnv...." is part of standard implementation of ssh: (e.g. https://linuxcommand.org/lc3_man_pages/ssh1.html : -o option). and will be "piped" to ssh *) if you use it with scp -o ... . But if it works with the lib I do not know.ghisler(Author) wrote: 2023-07-25, 07:45 UTC Sorry, I don't see how this would work before logging in. SSH just creates a remote shell, but you can't send commands until you are fully logged in.
*) and how it is handled than from/between ssh and sshd its there part...
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: How to add SetEnv in SFTP-settings?
2JOUBE
What do you mean with "piped to ssh"? To send commands via SSH, you have to open a channel through which you can then send shell commands like setenv. Do you mean that ssh -o SetEnv doesn't need a channel to send commands to the server?
What do you mean with "piped to ssh"? To send commands via SSH, you have to open a channel through which you can then send shell commands like setenv. Do you mean that ssh -o SetEnv doesn't need a channel to send commands to the server?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: How to add SetEnv in SFTP-settings?
As i have written in my edited (at the same time you answered) post: *) and how it is handled than from/between ssh and sshd its there part...ghisler(Author) wrote: 2023-07-25, 08:11 UTC 2JOUBE
What do you mean with "piped to ssh"? To send commands via SSH, you have to open a channel through which you can then send shell commands like setenv. Do you mean that ssh -o SetEnv doesn't need a channel to send commands to the server?
And it is not your part... and it is used IIRC for the separation of different users within the login process.
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: How to add SetEnv in SFTP-settings?
I found something in RFC 4254, is it that?
https://datatracker.ietf.org/doc/html/rfc4254#section-6.4
But it also requires a channel as parameter.
https://datatracker.ietf.org/doc/html/rfc4254#section-6.4
But it also requires a channel as parameter.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: How to add SetEnv in SFTP-settings?
All this is not your part. You only have to support the -o option. Im not sure this is possible with the lib. Or if you handle the login via the login yourself then you have to check how to handle option "setenv" with the lib. But all the -o options works with ssh itself.ghisler(Author) wrote: 2023-07-25, 08:17 UTC I found something in RFC 4254, is it that?
https://datatracker.ietf.org/doc/html/rfc4254#section-6.4
But it also requires a channel as parameter.
Last edited by JOUBE on 2023-07-25, 08:43 UTC, edited 4 times in total.