I've got a couple of issue with sudo and RCS (Revision Control System) that I can't figure out.
First issue: When I am logged in as my own personal account and I (for example) do an
(this is how I like it to be displayed)
Now when I do the same command but using sudo (ie:
How can I make sudo display and work the same way as though I was running the commands myself?
The other issue I have with sudo is when I try to pipe a command. An example is the following:
This would fail with an access denied but if I use
The second issue I have is with RCS. When I built my new server I started checking files into RCS. In the directory the config file existed in I created a directory called RCS and then checked the files in as follows:
and to check the file out I would run:
When you check the file in it changes the permissions to be read only for EVERYONE (including root). This prevents you from accidentally editing the file without checking it out first. In the beginning this worked perfectly and everytime I tried to edit a config file in RCS without checking it out first it would not save the file and I would have an access denied error.
Then I started using sudo and I find that when I edit a config file using sudo I can edit a config file WITHOUT having to check the file out! How is this so? Even if I log in as root I shouldn't be able to edit the file as it is in read only mode so why can using sudo allow changes to the file? What am I doing wrong?
First issue: When I am logged in as my own personal account and I (for example) do an
ls -l the output looks as follows:
Code:
drwxr-xr-x 5 root wheel 5B Jan 22 22:17 ./
drwxr-xr-x 5 root wheel 13B Mar 30 09:51 ../
drwxr-xr-x 15 root wheel 32B Jan 22 21:17 etc/
drwxr-xr-x 111 root wheel 114B Jan 22 22:17 pkg/
drwxr-xr-x 45 root wheel 45B Jan 22 21:18 ports/
(this is how I like it to be displayed)
Now when I do the same command but using sudo (ie:
sudo ls -l) the output looks as follows:
Code:
etc pkg ports
How can I make sudo display and work the same way as though I was running the commands myself?
The other issue I have with sudo is when I try to pipe a command. An example is the following:
Code:
zfs send -R -i zroot@Daily_$yesterday zroot@Daily_$today | zfs receive -duv tank/fs
This would fail with an access denied but if I use
su and become root then I can run the command. Is there a way to get commands like this to work with sudo?The second issue I have is with RCS. When I built my new server I started checking files into RCS. In the directory the config file existed in I created a directory called RCS and then checked the files in as follows:
Code:
ci -u /etc/login.conf
and to check the file out I would run:
Code:
co -l /etc/login.conf
When you check the file in it changes the permissions to be read only for EVERYONE (including root). This prevents you from accidentally editing the file without checking it out first. In the beginning this worked perfectly and everytime I tried to edit a config file in RCS without checking it out first it would not save the file and I would have an access denied error.
Then I started using sudo and I find that when I edit a config file using sudo I can edit a config file WITHOUT having to check the file out! How is this so? Even if I log in as root I shouldn't be able to edit the file as it is in read only mode so why can using sudo allow changes to the file? What am I doing wrong?