Loading ...
Sorry, an error occurred while loading the content.
 

Running root commands

Expand Messages
  • Cesar Moya
    Suppose I login to KDE or GNOME as user cesar and I need to run a program such as lokkit which only root can do. I open a command tool and type su and
    Message 1 of 3 , May 1, 2002
      Suppose I login to KDE or GNOME as user "cesar" and I need
      to run a program such as "lokkit" which only root can do.

      I open a command tool and type "su" and the password. Then
      I try to run that program but get "Command not found"
      error.

      The only way to run "lokkit" or similar programs (ifconfig
      for example) is by login out of "cesar" and login in as
      "root". Is this the way to do it?

      Cesar

      __________________________________________________
      Do You Yahoo!?
      Yahoo! Health - your guide to health and wellness
      http://health.yahoo.com
    • Godwin Stewart
      On Wed, 1 May 2002 06:06:11 -0700 (PDT), Cesar Moya ... This is because lokkit is probably in /sbin or in /usr/sbin which are not in
      Message 2 of 3 , May 1, 2002
        On Wed, 1 May 2002 06:06:11 -0700 (PDT), Cesar Moya <cesar1907@...>
        wrote to LINUX_Newbies@yahoogroups.com:

        > Suppose I login to KDE or GNOME as user "cesar" and I need
        > to run a program such as "lokkit" which only root can do.
        >
        > I open a command tool and type "su" and the password. Then
        > I try to run that program but get "Command not found"
        > error.

        This is because "lokkit" is probably in /sbin or in /usr/sbin which are not
        in your path.

        If you "switch user" to root, you obtain root privileges but you retain
        cesar's environment, including the search $PATH.

        If, OTOH, you were to do "su -" (rather than plain "su"), you would also
        inherit root's environment and be able to run lokkit.

        Alternatively, you can "become" root for the duration of the command, like
        so:

        $ su - -c lokkit

        --
        ____________________________________________
        | G. Stewart -- gstewart@... |
        | Port de Pontille, FR-37500 CHINON, FRANCE. |
        ____________________________________________
      • Scott Robbins
        ... From: Cesar Moya ... Short answer--it s not in the original path, you have to either type the complete path to the command or do su
        Message 3 of 3 , May 1, 2002
          ----- Original Message -----
          From: "Cesar Moya" <cesar1907@...>

          > Suppose I login to KDE or GNOME as user "cesar" and I need
          > to run a program such as "lokkit" which only root can do.
          >
          > I open a command tool and type "su" and the password. Then
          > I try to run that program but get "Command not found"
          > error.

          Short answer--it's not in the original path, you have to either type the
          complete path to the command or do su - (just a hyphen).
          Longer answer--it's covered in the unofficial faq for linux@yahoogroups and
          redhat@yahoogroups at

          http://home.nyc.rr.com/computertaijutsu/linfaq.html#found

          HTH
          Scott
        Your message has been successfully submitted and would be delivered to recipients shortly.