How can I edit a file with copies in 2 different users in 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 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.

Related

How to grant permissions to VS Code to modify files in Windows Subsystem for 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 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.

If there a way to make vsftpd allow one user to access root directory, while other users get redirected to their home directory? [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 1 year ago.
Improve this question
I'm running Raspbian Lite on a Raspberry Pi 2. I'm trying to have vsftpd set up with one user called admin to have root access for FTP, while all other users (such as filetransfer) get redirected to their home directory. Any help would be greatly appreciated :)
I gather you're using vsftpd's chroot_local_user setting to keep users within their home directories. If that's enabled, you can use the chroot_list_file setting to pass a file containing the users you don't want to be locked in their home directories.
You can find out more on the vsftpd manual page.

How are all files and directories created as root:root in smb mount ( RHEL)? [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
We have smb mount point in one of our RHEL server. By logging as normal user, any file or directory created by the user is shown as root:root. What configuration has been made to force user and group shown as root:root always ? I have checked /etc/samba/smb.conf, no configuration has been found. And also all file and directory getting created by normal user has full 777 permission. Appreciate any quickest help.
The userid/gid "owning" a particular mounted SMB partition are determined by its mounting configuration.
You may want to check this Q&A: https://unix.stackexchange.com/questions/68079/mount-cifs-network-drive-write-permissions-and-chown

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

Change linux user default ownership on file creation? [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
Seems like something which should be easy to find but Googling brings up lots of unrelated tasks.
I have a deploy scipt which runs under the user "deploy" but my web server runs as "nginx" I want the web server to be able to write to the deployed files.
Ive added nginx to the deploy user group and I believe I can write files with deploy user with the ownership "nginx:deploy" easily now but by default it creates files as "deploy:deploy" obviously which nginx won't write too.
Is there anyway to change the user so that by default creates files as "nginx:deploy" to solve this problem?
The install command has options to control the owner and group of the files it creates. But in general, only root can create files as a different user. Maybe you can configure sudoers to let the deploy user run the commands it needs with sudo as the nginx user.

Resources