RE: su -c user command not working

From: DiCioccio, Jason (jdicioccio@epylon.com)
Date: 03/22/02


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


 
-----BEGIN PGP SIGNED MESSAGE-----
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
:)

Cheers,
- -JD-

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

* Anthony Schneider <aschneid@mail.slc.edu> [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
for
             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 ;-)

Nicolas

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-security" in the body of the message

-----BEGIN PGP SIGNATURE-----
Version: PGP 7.0.4

iQA/AwUBPJubur8+wXo6G32BEQJtugCfREAjMZVH07wIIqihuF7hpN0mjbgAnAmK
bI2JYzZ31IzCAIU4u7PH2oMO
=i1Oj
-----END PGP SIGNATURE-----

To Unsubscribe: send mail to majordomo@FreeBSD.org
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 ...
    (gnu.announce)
  • 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‚ ...
    (comp.os.linux.misc)
  • 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. ...
    (comp.lang.java.programmer)
  • 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 _ ...
    (microsoft.public.vb.general.discussion)
  • 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 ...
    (comp.unix.shell)