On Sat, Apr 25, 2009 at 3:39 PM, Aaron Martinez <m...@proficuous.com> wrote:
> I'm running OpenBSD 4.4 Stable and have created a little shell script menu
> program that I want certain users to have as their only interaction with
> the system.  I created users using the script as their shell and also put
> it in /etc/shells but when the user logs in they get a standard shell.  I
> was testing it through ssh so I thought maybe it had something to do with
> the environment but the same thing happens when I log in locally.  If log
> in as root and then "su - <username>" the script runs as expected.
>
> Is this the wrong way to do this?  Would it be better putting something in
> the .profile?
>
> Can anyone shed any light as to why this is happening?

Works for me:

$ ls -l /usr/local/bin/foo
-rwxr-xr-x  1 root  wheel  55 Apr 25 17:25 /usr/local/bin/foo
$ cat /usr/local/bin/foo
#!/bin/sh
echo "hello!"
read help
echo "$help"
exit 0
$ grep testing /etc/passwd
testing:*:1009:1009:Test User,,,:/home/users/testing:/usr/local/bin/foo
$

...and when I log in on a terminal as 'testing', I get the expected
"hello!" and it echos my first line on input and then exits.

So:
1) what does the /etc/passwd entry for one of these users look like?
2) when you say "they get a standard shell", what *EXACTLY* do you mean?
   (If you mean "they get a /bin/sh prompt and it runs their
.profile", then please say that)
3) what does the top of the shell script look like?


Philip Guenther

Reply via email to