How to add SetEnv in SFTP-settings?
Posted: 2023-07-12, 09:55 UTC
How to add SetEnv
Forum - Public Discussion and Support
https://www.ghisler.ch/board/
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.
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.
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?
"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.
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?
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.