Forum Moderators: bakedjake
- Ryan
In the /etc/sudoers file, you'd add something like this:
myusername ALL= NOPASSWD: /usr/bin/vi
That will allow myusername to execute something like:
sudo vi /myfile.txt
That will run as root, without asking for a password, and vi the file. Keep in mind that bad things can happen still! (ex: sudo vi /etc/master.passwd wouldn't ask for a password).
It's a simple and quick way of fixing your problem.
To accomplish just this, you could make all of the find in /home readable and writable by group:
chmod 664 -R /home
That would set the permissions of all of the files in /home to -rw-rw-r--.
If the files belong to the "users" group, then anyone in that group would have read/write access to those files. If all of the users belong to you as you mentioned, then this would be fairly safe (since there are not users that are not you) and you could edit these files without being a root user.
You could also do a modification of the previous post, and simply prefix any editing commands with "sudo root", which would allow you to run that single command as root, and then drop privileges down after it had completed.
setfacl -r u:luckyguy:rw /home
find /home -type d -exec setfacl d:u:luckyguy:rwx \{\} \;