In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "the usage of passwd and su commands in Linux". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the usage of passwd and su commands in Linux.
Passwd command
The passwd command is used to change your password.
Syntax:
The grammar is
Passwd [command switch]
Command switch:
-a displays all items with password properties. -l lock the password. -d to delete the user password, login will not be a prompt password. -f forces the user to change the password the next time he logs in.
Example:
Passwd allows you to change your password when you enter the passwd directory directly. After entering the passwd command, you will receive the following three prompts:
Current password:
Enter a new password:
Re-enter the new password:
You must enter the password correctly for each prompt to change the password successfully.
Su command
Permissions: all users
Usage: su [- fmp] [- c command] [- s shell] [--help] [--version] [-] [USER [ARG]]
Description: to change to the identity of another user, you need to type the user's password except root.
Parameters:
-f or-fast do not need to read startup files (such as csh.cshrc, etc.) and are only used for csh or tcsh
The environment variable is not changed when-m-p or-preserve-environment executes su
-c command or-command=command change to the user with the account number USER and execute the instruction (command) and then change back to the original user
-s shell or-shell=shell specify the shell (bash csh tcsh, etc.) to be executed. The default value is the user (USER) shell in / etc/passwd.
-help display instruction file
-version displays version information
After the parameter-- l or-login is added, it is like re-login to the user. Most of the environment variables (HOME SHELL USER, etc.) are based on the user (USER), and the working directory will also change. If USER is not specified, it will be root.
User account number to be changed by USER
ARG passes in a new shell parameter
Example:
Su-c ls root changes the account to root and exits to change back to the original user after executing the ls instruction.
Su root-f changes the account to root and passes the-f parameter to the newly executed shell.
Su-clsung change the account to clsung and change the working directory to clsung's home directory (home dir).
At this point, I believe you have a deeper understanding of "the use of passwd and su commands in Linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.