![]() ![]() Ls: cannot access /home/tools/domains/domain.tools. If you run sudo -s that will start a shell as root. Now, when I'm trying to access the folder from the user "tools" (where this folder is located), I can do it easily with no problem: ~]$ ls -l /home/tools/domains//public_html/storage/usersĭrwxrwsr-x 7 root mygroup 4096 Dec 18 17:36 idīut, if I try to access this folder from a different user (in the same group), I get this error: ~]$ ls -l /home/tools/domains//public_html/storage/users Another way to switch to another account with sudo is to use the -s option. sudo also lets you control who can access root's capabilities, with granularity. ![]() If you want sudo to behave like su - with respect to HOME -that is, you want to use the target user's HOME environment variables, you can run sudo with the -H flag: sudo -H irssi. Linux How to Control sudo Access on Linux Dave McKay Nov 20, 2019, 8:00 am EDT 9 min read Fatmawati Achmad Zaenuri/Shutterstock The sudo command lets you run commands on Linux as though you were someone else, such as root. etc/sudoers: smith ALL (jones) /usr/local/bin/mycommand User smith runs: smith sudo -u jones /usr/local/bin/mycommand smith sudo -u jones mycommand If /usr/local/bin is in PATH User smith will be prompted for his own password, not jones’s. To run irssi as username with sudo: sudo -u username irssi. Solution Suppose you want user smith to be able to run a given command as user jones. Sudo chmod -R 2775 /home/tools/domains//public_html/storage/usersĬhmod ug+rwx -R /home/tools/domains//public_html/storage/users Like with su, you can use sudo to run commands as another, non- root user. Sudo chgrp -R mygroup /home/tools/domains//public_html/storage/users It doesn't help, and here is what I did (from root access): sudo usermod -a -G mygroup tools To delegate important tasks like server rebooting or restarting the Apache. I have created a group, added both users and grant access. A sudo user is typically a root user or any other user who has some privileges. I'm working with PHP, and I'm trying to access a folder of another user, and I always get the error "Permission denied". ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |