Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm running Ubuntu 11.04.

Suddenly my server stopped to recognize any commands:

ssh lisv22@chusmix.com
Password: 
-bash-3.2$ sudo
-bash: sudo: command not found

I think this has to due with a problem with $PATH:

-bash-3.2$ echo $PATH
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin

How can I fix this issue to make commands work again in SSH?

Also is this a problem with my server or my system? If I install Debian and try again from there will I be able to run commands? Any info about the issue will be accepted. Thanks

share|improve this question
    
locate sudo and see any useful information return –  ajreal Sep 10 '11 at 5:46
    
How do I locate sudo? Typing sudo on the terminal echoes info about the command. Just doesn't work on SSH. Can it be a problem with my server or just reinstalling Ubuntu/Debian fix it? –  Lisandro Vaccaro Sep 10 '11 at 5:54
    
If the problem is with my computer, that will be my answer. I can reinstall the system and I'm done with the problem. –  Lisandro Vaccaro Sep 10 '11 at 5:58
    
no,is your ssh login environment doses not set the path to sudo. locate sudo to get know the absolute path to command –  ajreal Sep 10 '11 at 6:04
add comment

migrated from stackoverflow.com Sep 10 '11 at 22:34

This question came from our site for professional and enthusiast programmers.

1 Answer

That is an odd $PATH - normally you'd have (at least) /usr/sbin and /sbin in there as well. Is there something special about the remote system?

The problem would appear to be on your server, though. When you ssh to a machine like that you're essentially running a full login on that system, just as if you had sat down at the machine and logged in to a VT. There's not a lot of scope for local changes to mess that up, at least not in the way that you're seeing.

What were you doing on the server prior to this problem appearing? What changes did you make? The sudo binary would usually be in /usr/bin, which is in your $PATH; is sudo actually still installed?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.