LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Real Problems With Sudo..please Help (https://www.linuxquestions.org/questions/linux-newbie-8/real-problems-with-sudo-please-help-611729/)

rolando1bueno 01-07-2008 08:02 AM

Real Problems With Sudo..please Help
 
Hi everyone,

Im newbie in the linux world and I'm mannaging a Ubuntu server 6.0
Ultimately I've had a lots of trouble using sudo command

first: when I'd used sudo it tell me it had wrong :)

Then I could use the sudo with no problems, but in almost no time, when i'd tried it again the following message apeared on screen.:confused::mad::cry:

server@server-Energetica:/usr$ sudo su
-bash: sudo: command not found

How the hell could I fix this shit without having to reinstall?
Please help....PLEASE :cry::cry::cry:

sincerely

Rodrigo

b0uncer 01-07-2008 08:16 AM

Quote:

How the hell could I fix this shit without having to reinstall?
Swearing won't do any good, so you can start off by stopping that.

"command not found" means your shell doesn't know where the executable for 'sudo' is. This can mean that it doesn't exist on the system, or more probably, it is not in a directory that is stored into your $PATH environment variable. The directories that are in $PATH variable are checked when ever you type a name that the shell interprets might be an executable. So for example if sudo was in /usr/bin/sudo but /usr/bin was not in $PATH, then issuing 'sudo' would not work. Instead adding /usr/bin to your $PATH or running 'sudo' with full path like this
Code:

/usr/bin/sudo
should do the job.

So first find out if the executable is on the system (it is, unless somebody removed it). You can use (s)locate if you have run 'updatedb' as root and the sudo executable has not been touched after that, or you can use find:
Code:

find / -type f -name sudo 2>/dev/null
This starts to look from / (and enters the subdirectories recursively), looking for a type f file (regular file) whose name is 'sudo'. The rest of the line (2>/dev/null) tells the shell to forward stderr messages (errors) to /dev/null, effectively not printing them to the screen. This is because if you run that as non-root user, you will get loads of "Permission denied" messages which we are not interested in here.

The result should find sudo executable if it is someplace you can access. If not, run the command as root and see why you can't access 'sudo', or reinstall sudo package.

rolando1bueno 01-08-2008 05:41 AM

Bouncer,
Thanks for your reply, and sory about the swearing, I've had some unneeded trouble with Ubuntu Server.

I've tryed using " /usr/bin/sudo " but I've got the error permission denied.
Then when I type " find / -type f -name sudo 2>/dev/null " but got no mesagge.

So, how do I run as root?
Which mod must the bin folder have? I know that sudo should be 0440, but the rest? To change sudo from 0664 to 0440 (that was my first problem) I did chmod 0440 to bin, was that correct?

When I do echo $PATH this is the answer:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games


Thanks for your answer.

Rodrigo


All times are GMT -5. The time now is 02:40 PM.