This site requires JavaScript to be enabled

Notifications

sudo (is something you don't do)

48 views

3.0 - Updated on 06/19/2021 by Denman, Jon

2.0 - Authored on 08/01/2019 by Frederick, Jon

Note: This article is about the sudo command on Systems-managed Khoury machines. For instructions on using sudo on your own machine or a machine on which you have been given the ability to run commands using sudo, please consult another documentation source.

What is sudo?

sudo (technically: "Substitute User DO", but also know as "Switch User DO" or "Super User DO") is a UNIX/Linux tool which can be used to allow certain accounts to execute certain commands as certain other accounts. It is most commonly used to allow non-privileged (non-root) accounts to run commands as the root or "Super User" account.

Who can run commands using sudo on Systems-managed Khoury machines?

Use of sudo on Systems-managed Khoury machines is restricted to members of the Systems group. If you need a change made to a system you are using, please contact the Systems group (khoury-systems@northeastern.edu or drop by 310 WVH).

Why can't I use sudo on a Systems-managed Khoury machine?

If you have sudo privileges on a machine but you don't know what you're doing or you aren't careful, it is very easy to destroy data and/or render the machine unusable for yourself and anyone else. sudo has no safety belt! sudo can also be used to violate the privacy of other people with accounts on a system (eg: copy another student's homework, read another person's email, etc).

As such, we restrict sudo privileges to a small group of staff in order to ensure the availability of Systems-managed Khoury machines and the privacy of those who use them.

Why should I pay attention to where I am running sudo?

Sometimes people will attempt to use sudo on Systems-managed Khoury machines because they've confused one terminal or ssh session with another, and they type something meant for one window (machine) into another window (machine).

You should always double check what machine you are typing on before running sudo. We at Khoury aren't likely to give anyone much trouble for mistakenly attempting to run sudo on the wrong machine, but in some jurisdictions or organizations attempting to use sudo on a machine on which you have not been authorized to sudo could potentially land you in legal trouble or cause you to lose your job.

Always double check which machine you're on before invoking sudo.

What are some poor reasons to use sudo?

One of the most common reasons we see students attempt to use sudo is that they are working on something, they run into a problem, and rather than taking (more) time to try to understand the problem, they decide to "hit it [the problem] with a bigger hammer." We understand the frustration that can come when something doesn't work, but most often reaching for sudo is the wrong approach, and wouldn't help even if the student was authorized to use sudo. Some examples:

More generally than those specific examples:

The above is only a limited set of examples, but they all speak to the same trend: Trying to compensate for a lack of understanding with digital brute-force. Sometimes that might work; most of the time it won't; but either way: How much are you really learning if you take this path?

Ok, but what about tasks that really can only be accomplished with sudo?

We do see folks trying to use sudo properly (albeit without permission) to solve their own problems. eg:

In those cases, please contact Systems with your request (we're generally happy to install most software and to make reasonable configuration changes that won't affect other people negatively). Finally: We see a large number of students attempt to install software which is already installed. ie: There's no need for anyone to sudo because the software is already there! For any software which isn't installed, of course, just contact Systems and ask that it be installed!

But I need to use to sudo to do ________!

If you are a student in a Khoury class: None of your course work should require you to use sudo on a Systems-managed machine. Either your instructor or TA will have designed your assignments such that they can be done without sudo (remember: your instructor doesn't have sudo on Systems-managed machines, either), or you should have been allotted a Virtual Machine or other system on which to work. If the latter is the case, your instructor will have given you instructions to this effect. If you think that you need sudo to do part of an assignment, please contact your instructor or TA, and that person will either give you other instructions or contact Systems to request resources on your behalf.

If you are a Khoury staff member, faculty member, graduate student, or research assistant and need sudo on the machines on which you work, please contact Systems or your faculty sponsor to discuss your needs, and we'll be happy to help!