In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to use sudo in Linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
The sudo mechanism makes it easy for you to perform administrative tasks occasionally as ordinary users.
You may have always wanted to know about Linux. Maybe it is used in your workplace, and if you use it every day, you will be more productive. Or maybe you want to install Linux on some computers at home. Whatever the reason, this series of articles is designed to make the transition easier.
Like many other operating systems, Linux supports multiple users. It even supports multiple users logging in at the same time.
User accounts are usually assigned a home directory where files can be stored. Usually this home directory is located at:
/ home/
In this way, each user has a separate location to store their own documents and other files.
Management task
In a traditional Linux installation, regular user accounts are not authorized to perform administrative tasks on the system. A typical system that installs Linux requires users to log in as administrators to perform certain tasks, rather than assigning permissions to each user to perform various tasks.
The administrator account on Linux is called root.
Sudo interpretation
Historically, to perform administrative tasks, you must log in as root, perform the task, and then log out. The process is a bit tedious, so many people log in as root and work as administrators all day. This can have disastrous consequences, such as accidentally deleting all files in the system. Of course, root users can do anything, so there is no protection from accidentally performing high-impact operations.
The sudo tool was created to make it easier for you to log in as a regular user account and occasionally perform administrative tasks as root without having to log in, perform tasks, and then log out. Specifically, sudo allows you to run commands as different users. If you do not specify a specific user, assume that you are referring to the root user.
Sudo can have complex settings that allow users to run certain commands using sudo, while others are not. In general, the installation of the desktop system will give the created * accounts full permissions in sudo, so you, as the primary user, can fully manage the Linux installation.
Use Sudo
Some systems where Linux is installed have sudo set up, so you still need to know the password of your root account to perform administrative tasks. Others, set up sudo to enter your own password. There are different philosophers here.
When you try to perform administrative tasks in a graphical environment, you usually open a dialog box that asks for a password. Enter your own password (for example, on Ubuntu) or the password for your root account (e.g., Red Hat).
When you try to perform administrative tasks on the command line, it usually only gives you a "permission denied" error. Then you rerun the command using sudo earlier. For example:
Systemctl start vsftpdFailed to start vsftpd.service: Access denied sudo systemctl start vsftpd [sudo] password for user1: when to use Sudo
Running commands as root (in sudo or other cases) does not always solve the * * solution for permission errors. Although running as root eliminates the "permission denied" error, sometimes * looks for the root cause rather than just solving the symptoms. Sometimes the file has the wrong owner and permissions.
Use sudo when you try a task or program that requires root permission to perform an operation. Do not use sudo if the file happens to be owned by another user, including the root user. In the second case, the permissions of the file are set correctly.
The above is all the content of the article "how to use sudo in Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.