Results 1 to 4 of 4

Thread: can't execute some command with sudo

  1. #1

    Default can't execute some command with sudo

    Hi,

    I would like to have an user that can execute al command with sudo.

    I configured sudo with yast2 and in the sudoers file actually there is a line with:

    USER ALL = (ALL) ALL

    Where user is my username.

    But I can't use some command like ifconfig becouse it say that it can't find the command. I think that this is becouse of path, but shouldn't i get root path using sudo?

    Can you help me?

    Thank you

  2. #2
    Join Date
    Aug 2008
    Location
    Seattle, WA
    Posts
    1,376

    Default Re: can't execute some command with sudo

    Using sudo you're still in the user's environment. Enter the full path, or change the user's PATH variable.

  3. #3
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: can't execute some command with sudo

    Or use sudo -i to get the target user's environment.

    Incidentally you do not need root privilege if you just want to run ifconfig to view the current config. Just do /sbin/ifconfig.

  4. #4

    Default Re: can't execute some command with sudo

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Better yet, move away from ifconfig since it is, by definition, obsolete
    on systems that matter. The ip command replaces it and (most importantly)
    is much shorter to type (and it's in the default path for users).

    ip addr

    for link information, including statistics:

    ip -s link

    and for route information, it's all here too!

    ip route

    Good luck.





    On 11/29/2010 08:06 AM, ken yap wrote:
    >
    > Or use sudo -i to get the target user's environment.
    >
    > Incidentally you do not need root privilege if you just want to run
    > ifconfig to view the current config. Just do /sbin/ifconfig.
    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.15 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

    iQIcBAEBAgAGBQJM8+IWAAoJEF+XTK08PnB52T4P/2zlIMezqWYLK/qQ/rQhgHU4
    LmandC/o24JN49BQyYvvt7kjlpY1Iz+Nb8oiUrTRr3dOK8FQl1jtJAGzGrdMmaPU
    ozoJEyMtk2ojOgDy4b0sBPQAUF1BLPnhsSodiVz9FppkELHVSdvFAbOROJwEO/kk
    jt0pLPyTJ3HuftVbJKMJTnBF3rRA6QJGLKMDKMqdrbGRy4XDBlPFv4ZARZzvVA4B
    oUjfUHFvw+fsK7Jbm0isw/UVP2bAgISqXe07V9x2+hym0Dkzkeh3n2c4VVsVp/pB
    YJuscIqKXtUUjwz0/m0QXBz5YDIz85yZju+AcSiv8Ja72iUvCq0BxGVh1LqF8zhU
    WK4kEuZdZTTz5CumAmeZYE96yeduvFBfUh+i1N1mwPobenMbYZB9gEmZRZMIlwyy
    XYyAO5BPRXt5YVZc93XixXPtbtM3pipyTD93FDmGJpR6vWtitCpsLYjsUXPzUb8a
    kW1LnqVvgTZnMl6a0p8e+e75I3Wl8rRpl4KUPkAJKaoD7sSO8pk1Qf4+/byKhwar
    nCBrwjgF8Rxv6gm8C0lTrtaM2xFuIrYc4/lvYvx6AR8bkTRPXjYibV2s5Gkjy0h9
    gcKZBF7Jj34VWiI/rwIr8akKe4BrUzZ0y7vZHTI6eUd7dMldPRkwUT7w9V4bmr/g
    tGjw7A0ukfQLBhwGQbO0
    =qr42
    -----END PGP SIGNATURE-----

Posting Permissions

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