-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Configure to open/write with sudo? #28
Comments
I'll be looking into this, but it's not planned right now. |
Would love to have support for this out of the box. I'm currently working around this by always making a copy of the file I want to edit to a folder where I have write permissions, edit the file in VS Code, and then use a ssh terminal to copy the edited file back using sudo. |
As an easier workaround, you can use something like this: chown -R root:sudo .;
chmod -R g+rwX .; Assuming your user is in the sudo group, which it should be if it can use sudo, all the files in the current directory (and subdirectories) will be owned by root and the sudo group, with read/write permissions added for the group. Basically, anyone with sudo has access to everything in the current directory and below. I think I found a (theoretical) way of accomplishing this, but I still need to implement and test it. |
This feature is now added (288f4ad) and published (extension version 1.10.0) I'll add documentation (#43) for it soon, but here's a summary:
An example configuration could be; {
"root": "/",
"putty": "test",
"name": "test",
"sftpCommand": "sudo /usr/lib/openssh/sftp-server"
} With this configuration, you'd be accessing files as root, or any other user, should you add the right parameter to the sudo command. Mind that creating files will also be in name of the given user, thus the ownership of the new file might be incorrect. If there are any issues, feel free to post them here or make a new issue. |
Thanks a lot for the nice extension. I also really need to have this sudo feature but unfortunately didn't manage to make it work for me. When I press connect it asks for password once and then status of configuration becomes orange. I can imagine that it tries to connect and ideally should ask me for sudo password once again but it doesn't my config
|
I am running this from Windows 10. I need to "sudo su - nextusername" but this does not work. |
I'm currently adding better support for sudo and sftpCommand. You can follow issue #104 for progress. |
Hi there,
I have access to a remote system with a given user (not root).
This user has sudo priviliges, thus I can view/edit any file in an SSH session and I would like to use VS Code SSH FS plugin to edit some configuration files. But sadly, it doesn't allow me to write those config files due to missing permissions.
Would it be possible to include a "sudo" option in configuration which will kind of run any read/write operation with sudo?
The text was updated successfully, but these errors were encountered: