On Tue, Mar 13, 2007 at 04:46:37PM -0600, Kenneth Burgener wrote:
> I got around to trying this today, but when I run my program I get an
> error saying:
> 
>  [EMAIL PROTECTED] ~]# su -l myuser -c "/usr/myapp/myprogram"
>  "This account is currently not available."
> 
> Originally I created this user in /etc/passwd as follows:
> 
>  myuser:x:500:500::/tmp:/sbin/nologin
> 
> When I changed the shell parameter to:
> 
>  myuser:x:500:500::/tmp:/bin/bash
> 
> I was able to run the fine, and it showed up in the 'ps' list as running
> as myuser:
> 

Try this:
su -l myuser -s /bin/bash -c "/usr/myapp/myprogram"

su by default uses the user's shell with -l if no shell is specificed.
-s lets you specify a shell*, so the user still doesn't have a vaild
shell except when you run it like this. I've actually found this quite
handy in debugging daemon account run programs.

Scott

* -s is a GNU extension

-- 
Scott Paul Robertson
http://spr.mahonri5.net
GnuPG FingerPrint: 09ab 64b5 edc0 903e 93ce edb9 3bcc f8fb dc5d 7601

Attachment: pgpZmK2suUco1.pgp
Description: PGP signature

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to