I just noticed it by typing random letters in. What does it do?
What does it do? Can someone tell me?
su
means Substitute User
It allows to go on the user specified after su
(assuming you know it’s password)
What? What does it do on Glitch?
The su command lets you switch the current user to any other user. If you need to run a command as a different (non-root) user, use the –l [username] option to specify the user account. Additionally, su can also be used to change to a different shell interpreter on the fly.
SU Command in Linux: How to Use With Examples
Ie. If you where root and you wanted to switch to “admin” you would run:
su - admin
su is a tool on these operating systems that support multiple users. It does what the documentation says it does, something about letting you temporarily log in as another user.
The operating system that Glitch uses supports multiple users, although the way Glitch uses containers makes the feature a lot less prominent. Each project gets its own container where it runs as the app
user. Thus there really isn’t anything for us users to do with su
.
It does serve at least some purpose in the big picture though. Glitch actually does have another user in the container, called root
, which it uses to run some infrastructural services, such as the piece of code that handles when you open the project console and launches a shell process. Now that’s a place where the need for su
comes up: the handler program, as a piece of infrastructure happens to run as root
, but the shell should run as app
. So it uses su
to do that there.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.