LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 01-07-2008, 09:02 AM   #1
rolando1bueno
LQ Newbie
 
Registered: Nov 2007
Posts: 6

Rep: Reputation: 0
Question 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.

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

sincerely

Rodrigo
 
Old 01-07-2008, 09:16 AM   #2
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
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.
 
Old 01-08-2008, 06:41 AM   #3
rolando1bueno
LQ Newbie
 
Registered: Nov 2007
Posts: 6

Original Poster
Rep: Reputation: 0
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

Last edited by rolando1bueno; 01-08-2008 at 07:53 AM.
 
  


Reply

Tags
sudo


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: The Ultimate Sudo FAQ To Sudo Or Not To Sudo? LXer Syndicated Linux News 13 04-13-2013 02:36 AM
real, real, real, basic computer for my Mom shengchieh General 3 12-18-2005 01:02 AM
Real Plyer...hehe ;) Giving me Real Problems.. Azzath Linux - Software 0 02-14-2005 09:56 AM
SUDO Problems da_tibmeister Linux - Security 5 08-03-2004 09:01 PM


All times are GMT -5. The time now is 08:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration