Skip to content

Instantly share code, notes, and snippets.

@jurf
Last active May 14, 2022 17:00
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jurf/6f04ce4f9bfa2268bce154fb6ea0a69b to your computer and use it in GitHub Desktop.
Save jurf/6f04ce4f9bfa2268bce154fb6ea0a69b to your computer and use it in GitHub Desktop.
#!/bin/sh
sudo dnf install --assumeyes openssh-server
sudo /usr/libexec/openssh/sshd-keygen rsa
sudo /usr/libexec/openssh/sshd-keygen ecdsa
sudo /usr/libexec/openssh/sshd-keygen ed25519
echo "
# For VS Code
Port 22$VERSION # Prevent conflicts with other SSH servers
ListenAddress localhost # Don’t allow remote connections
PermitEmptyPasswords yes # Containers lack passwords by default
PermitUserEnvironment yes # Allow setting DISPLAY for remote connections" | sudo tee -a /etc/ssh/sshd_config
echo "
Host toolbox-$VERSION
HostName localhost
Port 22$VERSION" >> ~/.ssh/config
sudo /usr/sbin/sshd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment