How important is the sudo password?

I know that the sudo password protects my computer from being locally hacked by someone having physical access to it.

I do not want to scare you too much, but if someone has physical access you handed access over to them regardless of how strong your password is. It will take 1 reboot by someone for that someone to be able change your root password (can be done from "grub rescue" without the need to supply your current password). By the way: this method is considered valid and a feature, and an accepted security risk (otherwise you would never be able to fix your system in case the password did get compromised).

but I know that it is not strong enough if someone can brute-force it remotely.

Here comes something else in play: a ROUTER should be smart enough to lock access from the outside if it is a repeated request asking for the same information over a short period of time. Basically what you have here is a DOS attack (or a DDOS if 2+ computers attacking you). A router should kill that connection and enforce a waiting period before accepting new requests from that connection.

Can anybody access my computer in root mode using my sudo password with no physical access to the computer, on a standard Ubuntu desktop installation ?

They first need to connect, then provide the sudo password. "root" mode is disabled and you can not directly log in to a "#" prompt.

Note that it is possible to abuse a service. If you have "ssh" running on that machine and they can "ssh" to your system, and get a hand on your username and password for that user (and as it is an admin user your sudo password too) they can access your machine and mess it up. By the way: if they do it like that they must have knowledge of your system first (like your password).

But then there is an issue with that (and any other method): how did they get your password? They can NOT get it from your system itself. And in general guessing is not worth the trouble. If it was socially engineered ... then your problem is there, not with the security model of your system, Ubuntu or Linux in general.

As long as your sudo password is yours you will/should be fine. And you will be even better off if it is a strong password (maybe easy to remember for you but not guessable by others). An example I used before when discussing this: If your dog is named "Abwegwfkwefkwe" using "Abwegwfkwefkwe" as a password is BAD even though it looks good (since someone could ask you: 'what is your dog's name' and they try that as a free guess). If you have no relation to "Abwegwfkwefkwe" it is a good password.

Best advice I can give:

  • do not enter your admin password when asked for it unless you know it was expected to be asked. If you open a browser and are given a popup that looks like our "asking for admin account password" ... stop ... and think first.

  • do not leave your system unattended when the "sudo" grace period is active. sudo --reset-timestamp removes the current grace period and will ask for the password again when you next use "sudo". Lock your screen when you go AFK.

  • do not install services or software for the fun of it. If you do not need ssh do not install ssh, if you do not use a webserver do not install a webserver. And have a look at the currently running services. If you do not use BT on a notebook, disable it. If you do not use a webcam disable it (if active). Delete software you do not use anymore.

  • and for the really paranoid (and yes Paranoid Panda I am looking at you): change the password every so often. You can even install rootkit hunters to check for inappropriate access.

  • backup your important data to something that you keep off-line. So even if you do find someone on your system you can format it, and start over with a new install and your data restored.


Yes they can.

There are multiple ways to do so though, and brute-forcing the sudo password is probably not the first one.

First off, the sudo password is your user's password; so really what they'd need to get is your password.

Second, cracking a user's password using brute-force to access a system is probably the last resort.

There are way more elegant (but mostly more effective) ways of breaking into another system.

Typically an attacker will either just go and try to exploit the most common vulnerabilities (the most known probably being getting a user shell by any means and exploit a ShellShock to get a root shell) or do a finest job along the lines of:

  • Scanning the open ports on the system in order to get information such as:
    • Operating system version
    • Running services version
  • Exploiting known operating system or running services' bugs (buffer overflows, ...) in order to get at least a user shell and then try to get a root shell (again, maybe exploiting a ShellShock)

Brute-forcing the sudo / user's password may be an attempt in case a root shell can't be obtained otherwise, but for example exploiting a service running as root won't require the attacker to brute-force the sudo / user's password.


  1. If I have learned anything in the last few years on security, then one thing: Nothing is impossible.

  2. As long as you have access to a network, definitely. Each service running on your system that can be accessed over the network is theoretically vulnerable and thus a potential weakness.

And therefore, for an attacker with enough ideas it is possible. You can make your system as secure as possible, but you cannot get to 100% safety ever.

It is therefore important to assess what is possible with justifiable technical effort and what protects you so well that you yourself can no longer work.