Last active
December 20, 2023 05:25
-
-
Save bluPhy/882f72784bdd6a9167d2d78f4e7bf35a to your computer and use it in GitHub Desktop.
workaround hack to open vscode remote as root without logging in as root
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Backup the original server.sh file | |
cp ~/.vscode-server/bin/*/server.sh ~/.vscode-server/bin/server.sh.bak | |
# Add sudo to node runner in server.sh | |
if sed -i "/node/s/^/sudo /" ~/.vscode-server/bin/*/server.sh; then | |
echo "sudo added to node runner in server.sh" | |
else | |
echo "Failed to add sudo to node runner. Please check the sed command." | |
exit 1 | |
fi | |
# Restart remote vscode | |
pkill -f vscode |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment