Users and sudo
หน้านี้ต้องใช้เบราว์เซอร์ล่าสุด (รองรับ SharedArrayBuffer) กรุณาอัปเดต Chrome, Edge, Firefox หรือ Safari เป็นเวอร์ชันล่าสุด
English
Many users, one computer
- Linux was built for many people to share one machine safely.
- Each person has a user account.
whoamitells you who you currently are:
whoami
- File ownership does not make files private. Their permissions determine which ordinary users can read or change them; administrators may have additional access.

English
The superuser: root
- One special user, root, has extensive administrator privileges, such as installing software and managing users. System security controls can still impose limits.
- With great power comes great danger: a wrong command as root can break the whole system.
- So you normally work as an ordinary user, and only become root when you must.
English
sudo — borrow root for one command
- When policy permits,
sudoruns a command as another user, normally root. It may ask for your password; cached authentication or policy can remove that prompt:
sudo apt install git
- Use it only when a task needs the permitted administrator rights. Read the command twice before pressing Enter. Our simulator supports
whoamiandhostname, but does not grant real administrator access.
English
Common mistakes
sudoruns one command as the administrator — use it carefully.- Do not put
sudoin front of everything.
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Print the name of the user you are logged in as, with whoami.
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Every machine has a name too. Print the name of the computer you are on with hostname.
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Save your user name in a file: send the output of whoami เข้าใน me.txt with >. The check reads me.txt.