Re: only one program per login

From: Stuart J. Browne (stuart_at_promed.com.au)
Date: 05/26/04


Date: Wed, 26 May 2004 12:06:49 +1000


"John DuBois" <spcecdt@deeptht.armory.com> wrote in message
news:40b3bf1c$0$439$8eec23a@newsreader.tycho.net...
> In article <fd1496bf.0405251239.1c21d7db@posting.google.com>,
> pablo hernandez <pablo@crecat.com> wrote:
> >We have some users connecting my server ( Os507 ) via ssh .
> >
> >I want to limit those users to only one program , and then exit again
from server.
> >
> >I do not want them , in any case to go to the shell.
> >
> >To achieve this I put in the .profile
> >>>>>
> >run myprogram
> >
> >logout
> >
> >>>>>
> >
> >having also eliminating the possibility of QUIT KILL and DEL .
> >
> >
> >Is this a safe procedure , or can be broken by the user ?
> >
> >Any advise for a better option ?
>
> If you want to be *certain* that the user can't escape from this by
hitting an
> interrupt key at just the right moment during login, make a shell script
that
> contains:
>
> #!/bin/sh
> run myprogram
>
> Make the script publicly readable & executable, and make it be the user's
login
> shell. If you do any important environment setup in /etc/profile, you'll
need
> to duplicate that in the script, or perhaps just source /etc/profile from
it:
>
> #!/bin/sh
> . /etc/profile
> run myprogram

wouldn't it also be advisable to 'exec myprogram' at the end of the script,
instead of just running it?

bkx



Relevant Pages

  • Re: completely OT: linx/bash guru needed
    ... Donnie Barnes wrote in ... What I want to do is run a bash script, but take what's in stdin of the ... cat /dev/stdin | myprogram arguments ...
    (rec.games.pinball)
  • Re: only one program per login
    ... in any case to go to the shell. ... >run myprogram ... Make the script publicly readable & executable, and make it be the user's login ...
    (comp.unix.sco.misc)
  • Re: completely OT: linx/bash guru needed
    ... Donnie Barnes wrote in ... the *script*, and immediately pass it to a program. ... cat /dev/stdin | myprogram arguments ... stdin, and I need to use the unix script to "shunt" it over to my php ...
    (rec.games.pinball)
  • Re: completely OT: linx/bash guru needed
    ... What I want to do is run a bash script, but take what's in stdin of the ... cat /dev/stdin | myprogram arguments ... shell script that has an excutable will get it automatically to it's stdin. ...
    (rec.games.pinball)
  • Re: limitation of user a/c ( telnet service )
    ... can modify the dot file... ... Another option might be from the "login" shell script to recreate the ...
    (Fedora)