I'm running Ubuntu 11.04.

Suddenly my server stopped to recognize any commands:

ssh [email protected]
-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

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

  • locate sudo and see any useful information return
    – ajreal
    Commented Sep 10, 2011 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? Commented Sep 10, 2011 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. Commented Sep 10, 2011 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
    Commented Sep 10, 2011 at 6:04

1 Answer 1


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?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .