Users and sudo · Người dùng và sudo
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · Trang này cần trình duyệt gần đây (hỗ trợ SharedArrayBuffer). Vui lòng cập nhật Chrome, Edge, Firefox hoặc Safari lên phiên bản mới nhất.
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:
- Your files are yours; other users cannot read or change them unless you allow it.
Tiếng Việt
Nhiều người dùng, một máy tính
- Linux được xây dựng để nhiều người dùng chung một máy tính an toàn.
- Mỗi người có một tài khoản người dùng.
whoamicho biết bạn hiện đang là ai:
whoami
- Tập tin của bạn là của riêng bạn; người dùng khác không thể đọc hoặc thay đổi trừ khi bạn cho phép.
English
The superuser: root
- One special user, root, can do anything — change any file, install software, manage other users.
- 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.
Tiếng Việt
Superuser: root
- Một tài khoản đặc biệt, root, có thể làm bất cứ điều gì — thay đổi mọi tập tin, cài đặt phần mềm, quản lý người dùng khác.
- Quyền lực lớn đi kèm nguy cơ lớn: một lệnh sai lầm ở chế độ root có thể phá hỏng toàn bộ hệ thống.
- Vì vậy, thông thường bạn làm việc như một người dùng thường, và chỉ trở thành root khi thực sự cần thiết.
English
sudo — borrow root for one command
sudoruns a single command as root (it asks for your password first):
- Think of it as "do this super-user do". Use it only when a task truly needs admin rights — and read the command twice before you press Enter.
Tiếng Việt
sudo — mượn quyền root cho một lệnh
sudothực thi một lệnh đơn lẻ dưới danh nghĩa root (nó sẽ hỏi mật khẩu của bạn trước):
sudo apt install git
- Hãy coi đó là "làm cái này super-user do". Chỉ sử dụng nó khi công việc thực sự cần quyền admin — và đọc kỹ lệnh hai lần trước khi nhấn Enter.
English
Common mistakes
sudoruns one command as the administrator — use it carefully.- Do not put
sudoin front of everything.
Tiếng Việt
Lỗi thường gặp
sudochạy một lệnh với tư cách administrator — hãy cẩn thận khi sử dụng.- Đừng đặt
sudotrước mọi thứ.
Print the name of the user you are logged in as, with whoami. · In tên người dùng mà bạn đang đăng nhập, sử dụng whoami.
Every machine has a name too. Print the name of the computer you are on with hostname. · Mỗi máy tính cũng có một tên. In tên máy tính bạn đang sử dụng bằng hostname.