-
Notifications
You must be signed in to change notification settings - Fork 803
Description
OpenSSH for Windows" version
7.7.2.0
Server OperatingSystem
Windows 10 Enterprise.
Client OperatingSystem
Windows 10 Enterprise.
What is failing
When executing a second command in the same session, sshd does not update the SSH_ORIGINAL_COMMAND environment variable.
After setting up a ForceCommand configuration, the issue can be replicated using the following python snippet.
import paramiko
cl = paramiko.client.SSHClient()
cl.load_system_host_keys()
cl.connect("<IP>", username="<USER>", password="<PASSWORD>")
cl.exec_command("ipconfig")
cl.exec_command("ping 127.0.0.1")
It seems that the issue is in do_exec_windows where the environment is updated only once per session.
Expected output
SSHD executes ipconfig and then ping.
Actual output
SSHD executes ipconfig twice.