I have a question about the Environment property of the TElSimpleSSHClient. How can i set my own environment variables? Or how can i get the environment from the sshd server? Or is it not possible to use this property with the simple client.

We are using the SecureBlackbox 5 VCL, SFTPBlackbox client-only package.

I have a question about the Environment property of the TElSimpleSSHClient. How can i set my own environment variables?

Please use the corresponding properties of the TElSimpleSSHClient.Environment object:

Client.Environment.Values['TEMP'] := '/tmp';

However, please keep in mind that a lot of servers ignore attempts to set environment variables due to security reasons.

Quote

Or how can i get the environment from the sshd server?

SSH protocol does not provide a built-in way for obtaining a list of environment variables, so you have to use some OS-dependent method (e.g. issuing the 'set' command and analysing its output for Win32-based servers).

We use cookies to help provide you with the best possible online experience. By using this site, you agree that we may store and access cookies on your device. You can find out more about and set your own preferences here.