Temporarily assign a shell to a user

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 ...


Go Back   Usenet Forums > System Security and Security Related > Linux Security

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-01-2005
Kai Lippok
 
Posts: n/a
Default Temporarily assign a shell to a user

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
Reply With Quote
  #2 (permalink)  
Old 08-01-2005
Rincewind
 
Posts: n/a
Default Re: Temporarily assign a shell to a user

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\
~~~~~~~~~~~~

Reply With Quote
  #3 (permalink)  
Old 08-02-2005
Unruh
 
Posts: n/a
Default Re: Temporarily assign a shell to a user

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.

Reply With Quote
  #4 (permalink)  
Old 08-02-2005
Kai Lippok
 
Posts: n/a
Default Re: Temporarily assign a shell to a user

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!
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:06 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0