Problem with sudo

Hi,

After a nice convention here in Brazil I decided to adhere to Suse (they gave me a nice beanie, so why not?) and just installed on my notebook.
I had problems with the backlight but got the same workaround I used before in another distro.

Although, I cannot seem to use ‘sudo’ for some reason. If I su then command, everything works wonders, if I try to sudo as a normal user, it always returns “command not found”. :\

Any ideas?

Cheers! :slight_smile:

You could change that but typically we use
su -

I think sudo is equivalent to su on openSUSE. so you don’t get the full root environment unless you use su - (note the dash)

You can provide the full path to the command in most cases /sbin/command

to see the difference become root with su and
echo $PATH
then become root with su - and
echo $PATH

Hi, welcome

Are we talking SUSE or openSUSE. AFAIK sudo is installed by default on openSUSE. If it’s not, you can install it with

zypper in sudo yast2-sudo

or through the software manager - check sudo and yast2-sudo for install and accept…

cordeirooo wrote:

>
> Hi,
>
> After a nice convention here in Brazil I decided to adhere to Suse (they
> gave me a nice beanie, so why not?) and just installed on my notebook.
> I had problems with the backlight but got the same workaround I used
> before in another distro.
>
> Although, I cannot seem to use ‘sudo’ for some reason. If I su then
> command, everything works wonders, if I try to sudo as a normal user, it
> always returns “command not found”. :
>
> Any ideas?
>
> Cheers! :slight_smile:
>
>
Is sudo installed?
CODE:

rpm -q sudo
sudo-1.8.6p3-3.13.1.x86_64

CODE:

which sudo
/usr/bin/sudo

On 2013-09-05 06:46, cordeirooo wrote:

> Although, I cannot seem to use ‘sudo’ for some reason. If I su then
> command, everything works wonders, if I try to sudo as a normal user, it
> always returns “command not found”. :\

Of course it does.

When you use “su”, you change the path, so you can find binaries
residing in /sbin. When you use sudo, the path is not changed, thus you
have to append the path:


sudo /sbin/fdisk


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

As I see it, we have two interpretations about the error “command not found” here:

  • some people think that it is sudo itself that can not be found;
  • others think that the command to be run through the sudo command is not found.

Reason of course is inadequate problem definition.

Please Cordeirooo, welcome to these forums.

That said plase note some of the good habits we have to make problems better understood by others. This so you get better answers concerning your problems.

First, you should allways tell which level of openSUSE you are using. We are unable to guess that.

Second allways back up your story telling with computer facts. In this case, you should have copied/pasted that sudo command and it’s output here in your post, so we can see the same as you see. As all computer output, copy/paste that between CODE tags. You get the CODE tags by clicking on the # button in the tool bar of the post editor. Do not forget to copy/paste complete: the prompt, the command, the output, the next prompt. It should look like this one (that has of course nothing to do with your problem, just to show you):

henk@boven:~> sudo ls
root's password:
bin  cassette  Desktop  Documents  Downloads  Fotos  logs  Mail  milweb  Muziek  qlgt.db  ripper  test
henk@boven:~>

Thanks for your cooperation