You are not logged in.
Is it possible to allow a user to execute cronjobs, without giving them a valid shell against their account?
I have a user that owns a website on my server (/srv/http/sites/domain.com) and there is a script that pulls data from another server via rsync so I want to run this script as the user.
I thought about changing the shell to /bin/bash and then adjusting .bashrc to just log the user out again, but the user has access to FTP so they could just delete the .bashrc file.
Last edited by fukawi2 (2009-09-07 22:23:55)
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
You could change the shell to /bin/bash, login as that user .. excecute "crontab ....", logout and then set the shell to /bin/false
Never done it .. but I think it should work
Offline
No, not quite what I mean... I can edit the users crontab file by passing the -u option to 'crontab', but cron can't actually execute the commands without the user having a valid shell at the time the command is due to run.
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Sounds like you're using vixie cron? dcron passes the cronjobs to /bin/sh, ignoring what the user's shell is declared to be (or even whether the user has a shell).
Or you could use my own, sweeter version of dcron: http://bbs.archlinux.org/viewtopic.php?id=78654
Offline
Uhhh, I'll get back to you
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Indeed you are correct... I'm used to vixie-cron from my RedHat/Fedora days, and it indeed appears that dcron can handle this situation OK
Sorry for the noise, I'll consider this solved
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline