ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Whenever cron runs a script, it becomes the owner of that script. nobody has lots of restrictions on it, but it has some advantages in that it is allowed to do some things that a normal user can not do and it can also do things that cron can not do also.
I've made a script which cron runs every few hours. the script is suppose to make a few changes to my home directory. The problem is that the script can not change my home directory because it is run as owned by cron whenever cron runs it.
Is there a way I can get cron to run the script as "nobody" since nobody can actually make changes to my home directory but cron can not.
I do not own the server with my home directory and I do not have any root access. On this server, scripts can not change owners or groups either. So my only option is to get cron to run the script as "nobody" some how without changing the owner of the script. Is there a way to do this?
I've made a script which cron runs every few hours. the script is suppose to make a few changes to my home directory. The problem is that the script can not change my home directory because it is run as owned by cron whenever cron runs it.
Strange behaviour! What OS is running on the server? If users are able to edit their own crontab, their cron jobs own to themselves. I have experience with crontab on a lot of OS (SUN, Linux, SuperUX) and the behaviour was exactly the same.
The server is a Red Hat Enterprise server. I think the administrator restricted all cron jobs to only a few permissions. I should have mentioned that this is a shared hosting server so there are many other users on the system who has the potential to get into other users directories. I think that is the reason why cron has so much restrictions on it. Well, I guess I need a better host, or I should just make my own..
SHELL is set to /bin/sh, and LOGNAME and HOME are set from the /etc/passwd line of the crontab´s owner. HOME and SHELL may be overridden by settings in the crontab; LOGNAME may not.
So, it looks like there is no chance of changing the owner of the cron jobs. This is reasonable from a security point-of-view. If the system administrator does not let the users to own their cron jobs, I think you have no chance.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.