How to grant permissions to VS Code to modify files in Windows Subsystem for Linux [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I connected VS Code to WSL and when I try to save changes in my index.php file the following message shows up.
I tried to change the permissions on var/www/html using chmod but nothing changed.
So how to make VS code modify the file?

Even I faced the same issue on my linux system, following command solved it:
Go to that directory from terminal.
Write sudo chown -R <username>:<group> <directory_name>. This command will change ownership (both user and group) of all files and directories inside of directory and directory itself.
To know the username write whoami in terminal.
To know the group write groups in terminal (The first name in the list is your group name) for me both username and groupname was same.

Open VS Code with Root User permission.

Related

Run node.js script as admin / Access protected file [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I'd like to access a file that needs specific rights to open and write it. I tried:
to convert it into a .exe file: found no working program for that
run in elevated cmd: still no admin privileges
WSL - Sudo command: don't work
For any suggestions about how to open a protected file please help me. (I have full access to the computer)
Windows, right?
Grant access permission for the file to the Windows user under which your nodejs program runs.
Use an account with Administrator privilege.
Right-click on the file or, better, its containing folder in the file explorer.
Open the Properties box (bottom of the right-click popup).
Open the Security tab and click the Edit button.
Then, if the user you want is in the list, grant the extra privilege needed. If not, use the Add button.

How can I edit a file with copies in 2 different users in linux? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I use AWS vps server and apache2 is installed in it. I want to edit a file "index.html" from 2 different accounts (i.e. 1st user "ubuntu" and second user "www-data"). By now, I try to edit the file but I got permission error so first I change (chown) permission to "ubuntu " and edit file and again change (chown) permission back to "www-data" otherwise I will get permission error in web browser.
I used chmod 777 index.html but this didn't help.
Please help me finding some good solution. Because this is tough to edit. I do have sudo permission if needed.
Thanks in advance!
You have two options:
create a dedicated group and add the ubuntu and www-data users to this group. Then set with chgrp the group of the file and finally give the right permissions to the group with chmod.
If your server suports Access Control Lists (it should), you could use the setfacl command. You can read about the command here and here.

SCP: file not found when trying to copy from windows to linux server [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
In putty i want to copy a .war file from my machine (at D:\\file.war) to a remote server like this:
sudo scp -r D://file.war user#xxx.xxx.xxx.xxx:/tomcat8/webapps
it doesn`t work and i have also tried things like:
sudo scp -r \file.war user#xxx.xxx.xxx.xxx:/tomcat8/webapps
or
sudo scp -r /cygdrive/d/file.war user#xxx.xxx.xxx.xxx:/tomcat8/webapps
I have to type in my password two times then (one time for sudo, next time for user). But then i get always the same error:
<pathtolocalfile>: No such file or directory
Putty always connects via SSH. I need sudo to get permission to write into the webapps folder.
How do i have to specify the path? Sry, i´m trying this for the first time and after some research i´m getting more and more confused about how to do this the right way.
I managed to do what i wanted, although my solution is not the nicest:
I connected to the server using WinSCP and my normal user account.
There i copied the file into my user home directory.
Then i opened the Putty console in WinSCP and changed to root user with "sudo" (and typing in my password again).
Now i finally was able to copy the file from my user accounts home directory into the webapps folder of tomcat.

Unix / Linux file permissions change for group preserve for user / world [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
Is this possible?
I have an issue granting a user access to website via FTP. The user can access them but cant delete or edit the files. I would like to change the permissions for the group so any user belonging to the group can edit those files but preserve (keep) the permissions for user / world.
Thanks in advance,
Joseph Mituzas
The command
chmod g+r filename
will merely add group read permissions to the file and not affect user or world permissions. The command
chmod g=rw filename
will replace the current group permissions with read/write.
Neither of these commands will affect user and world permissions

How to install a program in linux for all users not only for root? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I installed the shrewsoft vpnmanger on my linux (crunchbang kernel 3.2.0-4 amd64) the problem is, that somehow it can only be started as sudo. Can someone explain how i can fix this?
sudo /usr/local/sbin/iked&
How can I change the iked installation so that it is available for each user?
Thanks
It's just about the paths a normal user's shell search for commands. But normally it makes sense that those commands located in a sbin dir are not accessible by typing just the command's name. Those commands need access to protected resources that are only accessible by root.
But if you have the luck that you can gain the full rights by means of sudo you can simply create an alias via
alias iked="sudo /usr/local/sbin/iked"
and add it into your shell's resource file.
To make the full command accessible to all users by simply typing iked you can create a little bash script named iked with content
#!/bin/bash
sudo /usr/local/sbin/iked
and place it in /usr/local/bin.
Of course that implies an appropriate /etc/sudoers file and that the execute permission of iked is set.
try copying or symlinking in it in /usr/bin.
and see if it work for the user then, if it has a global log file (I don't know about this app so not one to comment) but assuming it has some log in /var/log/iked.log and its been written by root you will have permssion issues by another user, so chown it to some neutral group like users or something.:
Try here it may give you more info, I can see you could try:
/usr/bin/iked -d 4
But from what I read it does have a log in /var/log and yep that permission issue would be the primary issue specially if root was the first user to run this app.

Resources