Re: Query Regarding file permissions.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On May 10, 2007, at 3:59 AM, Ravi R.S wrote:
When I execute the following command

"sudo cat .schedule.out >> /var/spool/cron/root.txt"

I am getting error as "/var/spool/cron/root.txt: Permission denied"

But how can I make it to write as a "non root user".

The redirection (">> /var/spool/cron/root.txt") is processed by your shell before the shell invokes sudo. Since your shell is an unprivileged process, it fails to open /var/spool/cron/root.txt for appending. You have to:

	sudo sh -c 'cat .schedule.out >> /var/spool/cron/root.txt'

or the like, so that a privileged sh process performs the redirection.

---IWC

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux