ArticleslgStudy

science

Su (Unix)

Su (Unix) is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Su (Unix) rather than just read about it. In short: The Unix command su, which stands for "substitute user" (or historically "superuser"), is used by a computer user to execute commands with the privileges of another user account. When executed it invokes a shell without changing the current working directory or the user environment.

Key takeaways

  • Su (Unix) belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Su (Unix) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Su (Unix) from memory before moving on to harder problems.

Reference excerpt

The Unix command su, which stands for "substitute user" (or historically "superuser"), is used by a computer user to execute commands with the privileges of another user account. When executed it invokes a shell without changing the current working directory or the user environment. When the command is used without specifying the new user id as a command line argument, it defaults to using the superuser account (user id 0) of the system.

History The command su, including the Unix permissions system and the setuid system call, was part of Version 1 Unix. Encrypted passwords appeared in Version 3. The command is available as a separate package for Microsoft Windows as part of the UnxUtils collection of native Win32 ports of common GNU Unix-like utilities.

Usage When run from the command line, su asks for the target user's password, and if authenticated, grants the operator access to that account and the files and directories that account is permitted to access.

When used with a hyphen (su -) it can be used to start a login shell. In this mode users can assume the user environment of the target user.

The command sudo is related, and executes a command as another user but observes a set of constraints about which users can execute which commands as which other users (generally in a configuration file named /etc/sudoers, best editable by the command visudo). Unlike su, sudo authenticates users against their own password rather than that of the target user (to allow the delegation of specific commands to specific users on specific hosts without sharing passwords among them and while mitigating the risk of any unattended terminals). Some Unix-like systems implement the user group wheel, and only allow members to become root with su. This may or may not mitigate these security concerns, since an intruder might first simply break into one of those accounts. GNU su, however, does not support the group wheel for philosophical reasons. Richard Stallman argues that because the group would prevent users from utilizing root passwords leaked to them, the group would allow existing admins to ride roughshod over ordinary users.

See also Unix security List of Unix commands Comparison of privilege authorization features

Further reading "From Novice to Master, and Back Again". D-Mac's Stuff. 2013-01-14. Retrieved 2022-08-10.

References

External links su – manual pages from GNU coreutils. su(1) – Linux User Commands Manual su(1) – FreeBSD General Commands Manual su(8) – Solaris 11.4 System Administration Commands Reference Manual The su command – by The Linux Information Project (LINFO) (Archived 20 October 2021 at the Wayback Machine)

Worked examples

Example 1 — a first encounter with Su (Unix)

Start with the simplest possible case. Write down what Su (Unix) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Su (Unix) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Su (Unix) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Su (Unix)

In research
Su (Unix) appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Su (Unix) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Su (Unix) is common in secondary-school and first-year university syllabi. It links to neighbouring topics System administration, Unix stubs, Unix user management and support-related utilities, so understanding it makes those chapters shorter.
In everyday life
Look for Su (Unix) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Su (Unix)” →

How to study Su (Unix) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Su (Unix) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Su (Unix) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Su (Unix) in simple terms?

The Unix command su, which stands for "substitute user" (or historically "superuser"), is used by a computer user to execute commands with the privileges of another user account. When executed it invokes a shell without changing the current working directory or the user environment.

Why does Su (Unix) matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Su (Unix)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Su (Unix).

Tags

  • System administration
  • Unix stubs
  • Unix user management and support-related utilities

Keep exploring