Results 1 to 5 of 5

Thread: Why does "sudo" not work?

  1. #1

    Default Why does "sudo" not work?

    When I type "sudo rcalsasound restart", and then type my password (at the prompt), it says, "command not found"!

    However, if I type "su" and then my password (at the prompt) and THEN at a super user login, type "rcalsasound restart", it works!

    Why doesn't it work with sudo?

  2. #2

    Default Re: Why does "sudo" not work?

    Quote Originally Posted by 6tr6tr View Post
    When I type "sudo rcalsasound restart", and then type my password (at the prompt), it says, "command not found"!

    However, if I type "su" and then my password (at the prompt) and THEN at a super user login, type "rcalsasound restart", it works!

    Why doesn't it work with sudo?
    I am not using sudo but maybe this is worth checking for opensuse sudo
    Administer with Sudo - openSUSE

    I use kdesu or gksu
    People who do not break things first will never learn to create anything

  3. #3
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    27,128
    Blog Entries
    15

    Default Re: Why does "sudo" not work?

    Quote Originally Posted by 6tr6tr
    When I type "sudo rcalsasound restart", and then type my password (at
    the prompt), it says, "command not found"!

    However, if I type "su" and then my password (at the prompt) and THEN
    at a super user login, type "rcalsasound restart", it works!

    Why doesn't it work with sudo?
    Hi
    Because sudo doesn't know the path to the file, generally it's
    either /sbin/ or /usr/sbin;
    Code:
    sudo /usr/sbin/rcalsasound restart
    --
    Cheers Malcolm (Linux Counter #276890)
    openSUSE 11.0 x86 Kernel 2.6.25.18-0.2-default
    up 12:30, 2 users, load average: 0.42, 0.51, 0.34
    GPU GeForce 6600 TE/6200 TE - Driver Version: 177.80


  4. #4

    Default Re: Why does "sudo" not work?

    Quote Originally Posted by malcolmlewis View Post
    Hi
    Because sudo doesn't know the path to the file, generally it's
    either /sbin/ or /usr/sbin;
    Code:
    sudo /usr/sbin/rcalsasound restart
    --
    Cheers Malcolm (Linux Counter #276890)
    openSUSE 11.0 x86 Kernel 2.6.25.18-0.2-default
    up 12:30, 2 users, load average: 0.42, 0.51, 0.34
    GPU GeForce 6600 TE/6200 TE - Driver Version: 177.80
    Thanks!

    Why does "su" know the path (i.e. once logged in as super user) but sudo does not?

  5. #5
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    27,128
    Blog Entries
    15

    Default Re: Why does "sudo" not work?

    Quote Originally Posted by 6tr6tr
    malcolmlewis;1888700 Wrote:
    > Hi
    > Because sudo doesn't know the path to the file, generally it's
    > either /sbin/ or /usr/sbin;
    > >

    Code:
    --------------------
    > >

    > sudo /usr/sbin/rcalsasound restart
    >

    --------------------
    > >

    >
    > --
    > Cheers Malcolm (Linux Counter #276890)
    > openSUSE 11.0 x86 Kernel 2.6.25.18-0.2-default
    > up 12:30, 2 users, load average: 0.42, 0.51, 0.34
    > GPU GeForce 6600 TE/6200 TE - Driver Version: 177.80


    Thanks!

    Why does "su" know the path (i.e. once logged in as super user) but
    sudo does not?
    Hi
    When you su it looks at the user (root) .profile (if it exists)
    and .bashrc and others when you enter the root shell.

    There are also defaults in the /etc directory which setup the user
    environment. Have an look at man bash, man env.

    Have a look at yours by running the following;
    Code:
    env
    So it will basically add a PATH variable. If you run the following
    commands you will see how it changes. If you only use su it won't
    source any environment variables set for root user as you haven't
    entered the root directory;
    Code:
    echo $PATH
    su
    echo $PATH
    exit
    su -
    echo $PATH
    --
    Cheers Malcolm (Linux Counter #276890)
    openSUSE 11.0 x86 Kernel 2.6.25.18-0.2-default
    up 13:52, 2 users, load average: 0.28, 0.18, 0.14
    GPU GeForce 6600 TE/6200 TE - Driver Version: 177.80


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •