-
Notifications
You must be signed in to change notification settings - Fork 536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Allow setting environment variables from the URL #371
Comments
Environment Variables via URLWebSSH2 supports passing environment variables through URL parameters, allowing you to customize the SSH session environment. This feature enables scenarios like automatically opening specific files or setting custom environment variables. Server ConfigurationBefore using this feature, you must configure your SSH server to accept the environment variables you want to pass. Edit your # Allow client to pass locale environment variables and custom vars
AcceptEnv LANG LC_* VIM_FILE CUSTOM_ENV Remember to restart your SSH server after making changes: sudo systemctl restart sshd # For systemd-based systems
# or
sudo service sshd restart # For init.d-based systems UsagePass environment variables using the # Single environment variable
http://localhost:2222/ssh/host/example.com?env=VIM_FILE:config.txt
# Multiple environment variables
http://localhost:2222/ssh/host/example.com?env=VIM_FILE:config.txt,CUSTOM_ENV:test Security ConsiderationsTo maintain security, environment variables must meet these criteria:
Invalid environment variables will be silently ignored. Example Usage
TroubleshootingIf environment variables aren't being set:
|
via @israel-tsadok-silk from #368
The text was updated successfully, but these errors were encountered: