This is a discussion on Temporarily assign a shell to a user within the Linux Security forums, part of the System Security and Security Related category; I run a webserver with several mailusers. These users do not require a shell. Now I want to fetch external ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I run a webserver with several mailusers. These users do not require a
shell. Now I want to fetch external mails with fetchmal for some of these users but fetchmail doesn't work without a shell, of course. So is there a way to assign a user a valid shell for a short period of time? Thx, Kai |
|
|||
|
On Mon, 01 Aug 2005 17:33:34 +0200, Kai Lippok mumbled something like
this: > I run a webserver with several mailusers. These users do not require a > shell. Now I want to fetch external mails with fetchmal for some of these > users but fetchmail doesn't work without a shell, of course. > > So is there a way to assign a user a valid shell for a short period of > time? > > Thx, > > Kai Why not just set up a cron job to pull the mail with fetchmail. If you, as root, run 'crontab -u username -e', it seems to work for users without a shell(assumes they have a home directory). Do your users have a home directory? If so, store the .fetchmailrc files there. If not, you will have to store them somewhere else. Create a directory in /etc perhaps... So for a user called joe, a line similar to(should all be one line, but may wrap here): */10 * * * * /usr/bin/fetchmail -v -f /joe/.fetchmailrc -L /var/log/fetchmail.log Depending on your mail server and its authentication requirements, you may also need the: --auth password option. Alternatively, you could use the global crontab in /etc/crontab. This will require the username field though. As in: */10 * * * * joe /usr/bin/fetchmail -v -f /joe/.fetchmailrc -L /var/log/fetchmail.log Add similar lines for all the users you want to pull mail for. Both the above lines should pull joe's mail every 10 minutes. -- Rinso /\ / \ /wizz\ ~~~~~~~~~~~~ |
|
|||
|
Kai Lippok <REMOVETHIS_public@kl-mail.de> writes:
>I run a webserver with several mailusers. These users do not require a >shell. Now I want to fetch external mails with fetchmal for some of >these users but fetchmail doesn't work without a shell, of course. >So is there a way to assign a user a valid shell for a short period of time? >Thx, > Kai Could use pam to do this I suspect. Just write a pam lib function to change the shell on logon. On logoff it might be more difficult, since the system could crash and pam is not run on logoff I do not believe. |
|
|||
|
Rincewind schrieb:
> On Mon, 01 Aug 2005 17:33:34 +0200, Kai Lippok mumbled something like > this: > > >>I run a webserver with several mailusers. These users do not require a >>shell. Now I want to fetch external mails with fetchmal for some of these >>users but fetchmail doesn't work without a shell, of course. >> >>So is there a way to assign a user a valid shell for a short period of >>time? >> >>Thx, >> >> Kai > > > Why not just set up a cron job to pull the mail with fetchmail. If you, as > root, run 'crontab -u username -e', it seems to work for users without a > shell(assumes they have a home directory). > > Do your users have a home directory? If so, store the .fetchmailrc files > there. If not, you will have to store them somewhere else. Create a > directory in /etc perhaps... > > So for a user called joe, a line similar to(should all be one line, but > may wrap here): > > */10 * * * * /usr/bin/fetchmail -v -f /joe/.fetchmailrc -L > /var/log/fetchmail.log > > Depending on your mail server and its authentication requirements, you may > also need the: > > --auth password > > option. > > Alternatively, you could use the global crontab in /etc/crontab. This will > require the username field though. As in: > > > */10 * * * * joe /usr/bin/fetchmail -v -f /joe/.fetchmailrc -L > /var/log/fetchmail.log > > Add similar lines for all the users you want to pull mail for. > > Both the above lines should pull joe's mail every 10 minutes. > Thats what I was looking for. I'll try it tommorow. Thx! |