RE: su -c user command not working

From: DiCioccio, Jason (
Date: 03/22/02

From: "DiCioccio, Jason" <>
To: 'Nicolas Rachinsky' <>, FreeBSD Security <freebsd-security@FreeBSD.ORG>
Date: Fri, 22 Mar 2002 12:53:04 -0800

Hash: SHA1

No, the reason this works is because you're passing the -c to the shell
which su invokes. Most shells take a -c argument. This is why -c is passed
after the username, su -c <class> username would be what you are thinking of

- -JD-

- -----Original Message-----
From: Nicolas Rachinsky []
Sent: Friday, March 22, 2002 12:50 PM
To: FreeBSD Security
Subject: Re: su -c user command not working

* Anthony Schneider <> [2002-03-22 15:36:57 -0500]:
> the -c flag passes a command to the shell of the user you are su'ing to,

man su
     -c class
             Use the settings of the specified login class. Only allowed
             the super-user.

> so since user man's shell is /sbin/nologin, /sbin/nologin is (according
> to su) supposed to interpret the command 'catman' and execute it,
> however /sbin/nologin doesn't interpret commands, it just prints the
> message "This account is currently unavailable" (just as it did for you)
> and then exits. for 'su -c' to work, the user you are su'ing to needs
> something to actually interpret the command. i suggest you either change
> that user's passwd info to have such a shell, or you to an account that
> has such a shell.

I think for 'su -c' to work as expected here, you have to use some
linux distri ;-)


To Unsubscribe: send mail to
with "unsubscribe freebsd-security" in the body of the message

Version: PGP 7.0.4


To Unsubscribe: send mail to
with "unsubscribe freebsd-security" in the body of the message

Relevant Pages

  • Bash-4.0 available for FTP
    ... Unlike previous bash distributions, this tar file includes the formatted ... The shell has been changed to be more ... rigorous about parsing commands inside command substitutions, ... Changes have been made to the Readline library being released at ...
  • Why newbies dont RTFM...
    ... Even though I've used Linux before, I've never had to do any ... BASH BUILTIN COMMANDS ... last command exited within ... unless the shell is not exeâ ...
  • Re: Great SWT Program
    ... None of the nasty things that you have said or implied about me are at ... treat the file as input (manually invoking the command interpreter ... script, copy the line into that within the editor, exit, and invoke ... the shell script. ...
  • Re: Shell function - accessing an Access secure db (.MDW file)
    ... > Hi - Does anyone know the correct syntax for the shell function. ... You can use the Shell command. ... To execute internal DOS command (Dir, Copy, ... Private Declare Function OpenProcess _ ...
  • Re: ksh silently ignores function if mistakenly not autoloaded
    ... Here's the order of execution. ... This really takes place prior to command ... Shell scripts, with all their power, have one major drawback - they ... In the Korn Shell, there are two separate syntaxes for defining ...