SUDO question - Aix

This is a discussion on SUDO question - Aix ; When I run the following command as user foo: sudo -u joeuser -i env I get the following: ksh: env: cannot execute This applies to any command I try to follow sudo -u joeuser -i with. When I run the ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: SUDO question

  1. SUDO question

    When I run the following command as user foo:

    sudo -u joeuser -i env

    I get the following:

    ksh: env: cannot execute

    This applies to any command I try to follow sudo -u joeuser -i with.

    When I run the following command:

    sudo -u joeuser -i

    I get back a shell where I can now run env, ls, etc.

    My sudoers file contains the following lines:

    # sudoers file.
    #
    # This file MUST be edited with the 'visudo' command as root.
    #
    # See the sudoers man page for the details on how to write a sudoers
    file.
    #

    # Host alias specification

    # User alias specification
    Runas_Alias LAW = joeuser

    # Cmnd alias specification

    # Defaults specification

    # User privilege specification
    root ALL=(ALL) ALL
    foo ALL=(LAW) NOPASSWD: ALL

    # Uncomment to allow people in group wheel to run all commands
    # %wheel ALL=(ALL) ALL

    # Same thing without a password
    # %wheel ALL=(ALL) NOPASSWD: ALL

    # Samples
    # %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
    # %users localhost=/sbin/shutdown -h now

    The version of sudo is:

    Sudo version 1.6.8p12

    Anyone have an idea what might be going on here?


  2. Re: SUDO question

    loose the -i...it specifically runs the user's shell...try "sudo -u
    USERNAME COMMAND"

    On Oct 16, 3:12 pm, "Michael" wrote:
    > When I run the following command as user foo:
    >
    > sudo -u joeuser -i env
    >
    > I get the following:
    >
    > ksh: env: cannot execute
    >
    > This applies to any command I try to follow sudo -u joeuser -i with.
    >
    > When I run the following command:
    >
    > sudo -u joeuser -i
    >
    > I get back a shell where I can now run env, ls, etc.
    >
    > My sudoers file contains the following lines:
    >
    > # sudoers file.
    > #
    > # This file MUST be edited with the 'visudo' command as root.
    > #
    > # See the sudoers man page for the details on how to write a sudoers
    > file.
    > #
    >
    > # Host alias specification
    >
    > # User alias specification
    > Runas_Alias LAW = joeuser
    >
    > # Cmnd alias specification
    >
    > # Defaults specification
    >
    > # User privilege specification
    > root ALL=(ALL) ALL
    > foo ALL=(LAW) NOPASSWD: ALL
    >
    > # Uncomment to allow people in group wheel to run all commands
    > # %wheel ALL=(ALL) ALL
    >
    > # Same thing without a password
    > # %wheel ALL=(ALL) NOPASSWD: ALL
    >
    > # Samples
    > # %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
    > # %users localhost=/sbin/shutdown -h now
    >
    > The version of sudo is:
    >
    > Sudo version 1.6.8p12
    >
    > Anyone have an idea what might be going on here?



+ Reply to Thread