- Как изменить пароль пользователя в Linux. Команда Passwd
- How to Change User Password in Linux
- В этом руководстве мы объясним, как изменить пароль пользователя в Linux. Мы также покажем вам, как заставить пользователей изменить свой пароль при следующем входе в систему.
- Изменить свой пароль пользователя
- Изменить пароль другого пользователя
- Принудительно изменить пароль при следующем входе в систему
- Вывод
- How do I change a user password in Ubuntu Linux?
- How to change a user password in Ubuntu
- How to change a root (superuser) password in Ubuntu
- How do I change the user account password on Ubuntu?
- Deleting a user password
- Linux locking an account
- Linux unlocking an account
- Conclusion
- How to Change Your User Password In Linux
- Linux set password instructions
- How to Change Your Linux Password
- Linux: Reset User Password
- How To Set or Change User Password In Linux?
- Change Current User Password
- Change Different User Password.
- Change Group Password
Как изменить пароль пользователя в Linux. Команда Passwd
How to Change User Password in Linux
В этом руководстве мы объясним, как изменить пароль пользователя в Linux. Мы также покажем вам, как заставить пользователей изменить свой пароль при следующем входе в систему.
Инструкции должны работать на любом дистрибутиве Linux, включая Ubuntu, Debian и CentOS.
В Linux вы можете изменить пароль учетной записи пользователя с помощью passwd утилиты.
Зашифрованные пароли пользователей, а также другая информация, связанная с паролями, хранятся в /etc/shadow файле.
Как обычный пользователь, вы можете изменить только свой собственный пароль. Пользователь root и пользователи с привилегиями sudo могут изменять пароли других пользователей и определять, как можно использовать или изменять пароль.
При смене пароля убедитесь, что вы используете надежный и уникальный пароль.
Надежный пароль — это самое важное, что вы можете сделать для защиты своей учетной записи. Часто надежный пароль содержит не менее 16 символов и содержит как минимум одну заглавную букву, одну строчную букву, одну цифру и один специальный символ.
В целях безопасности рекомендуется регулярно обновлять пароль и использовать уникальный пароль для каждой учетной записи.
Изменить свой пароль пользователя
Чтобы изменить пароль своей учетной записи, введите passwd команду без аргументов:
Вам будет предложено ввести текущий пароль. Если пароль правильный, команда попросит вас ввести и подтвердить новый пароль.
Пароли не отображаются на экране при их вводе.
При следующем входе в систему используйте новый пароль.
Изменить пароль другого пользователя
Как мы упоминали во введении, только пользователь root и пользователи, имеющие sudo доступ, могут изменять пароль другой учетной записи.
В следующем примере предполагается, что вы вошли в систему как пользователь с привилегиями sudo.
Чтобы изменить пароль другой учетной записи пользователя, введите passwd команду, а затем имя пользователя. Например, чтобы изменить пароль пользователя с именем baks , выполните следующую команду:
Вам будет предложено ввести и подтвердить новый пароль:
В случае успеха команда напечатает что-то вроде этого:
Принудительно изменить пароль при следующем входе в систему
По умолчанию пароли никогда не истекают. Чтобы заставить пользователя изменить свой пароль при следующем входе в систему, используйте passwd команду с —expire параметром, за которой следует имя пользователя:
Приведенная выше команда немедленно истечет пароль пользователя.
В следующий раз, когда пользователь попытается войти со старым паролем, ему будет показано сообщение, заставляющее его сменить пароль:
Как только пользователь установит новый пароль, соединение будет закрыто.
Вывод
В этом уроке вы узнали, как изменить пароли пользователя и как установить срок действия пароля.
Вы можете найти больше информации о команде passwd, набрав man passwd в своем терминале или посетив страницу руководства Linux passwd .
Источник
How do I change a user password in Ubuntu Linux?
W e recently switched from Windows server operating system to Ubuntu Linux operating system at work. I am a developer by profession and do not know much about Linux. I need to change the sftp/ssh user account password on Ubuntu. How do I change a user password in Ubuntu Linux?
Introduction – Your Ubuntu Linux account information stored in a file named /etc/passwd and encrypted password in /etc/shadow . This page explains to you how to change the Ubuntu Linux root and user account password using the passwd command line.
Tutorial details | |
---|---|
Difficulty level | Easy |
Root privileges | Yes |
Requirements | Ubuntu Linux |
Est. reading time | 2 minutes |
How to change a user password in Ubuntu
- Open the terminal application by pressing Ctrl + Alt + T
- To change a password for user named tom in Ubuntu, type:
sudo passwd tom - To change a password for root user on Ubuntu Linux, run:
sudo passwd root - And to change your own password for Ubuntu, execute:
passwd
How to change a root (superuser) password in Ubuntu
Firstly, open a terminal window. If you want to change the password for remote Ubuntu server, log in using the ssh command:
ssh user@ubuntu-server-ip
ssh vivek@ubuntu-webserver-1
Type ‘sudo -i’ at the command prompt, and Enter key:
sudo -i
Type the current user password and press Enter key. Finally type NA command and press Enter to change password for root user:
passwd
Change password for root user on Ubuntu
How do I change the user account password on Ubuntu?
Again open a terminal window. Type the following command to change the password for regular Ubuntu user account named jerry:
sudo passwd < userNameHere >
sudo passwd jerry ## ##
sudo passwd vivek ## ##
How to change the user Password in Ubuntu Linux
Deleting a user password
Users will not be able to log in when the password is deleted or expired on Ubuntu Linux.
- No ads and tracking
- In-depth guides for developers and sysadmins at Opensourceflare✨
- Join my Patreon to support independent content creators and start reading latest guides:
- How to set up Redis sentinel cluster on Ubuntu or Debian Linux
- How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
- How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
- A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
- How to protect Linux against rogue USB devices using USBGuard
Join Patreon ➔
The syntax is as follow to remove the password for the account called tom:
sudo passwd -d tom
## OR ##
sudo passwd —delete jerry
You will see confirmation on screen as follows:
To set up a new password when deleted, run:
sudo passwd -d tom
We can also force expire the password for the named account jerry. Open the terminal and then type the following command:
sudo passwd -e jerry
sudo passwd —expire jerry
When user login they will be forced to reset their credentials when you use the -e / —expire option:
Linux locking an account
sudo passwd -l
sudo passwd -l tom
Linux unlocking an account
sudo passwd -u
sudo passwd -u tom
Conclusion
This quick tutorial taught you how to change the Ubuntu Linux root user and other user account password using the passwd command. You must root user to change the password for all other users, however users can change their password without sudo access. For more info see the passwd command help page using the man command man passwd
🐧 Get the latest tutorials on Linux, Open Source & DevOps via
Category | List of Unix and Linux commands |
---|---|
Documentation | help • mandb • man • pinfo |
Disk space analyzers | df • duf • ncdu • pydf |
File Management | cat • cp • less • mkdir • more • tree |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Linux Desktop Apps | Skype • Spotify • VLC 3 |
Modern utilities | bat • exa |
Network Utilities | NetHogs • dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • glances • gtop • jobs • killall • kill • pidof • pstree • pwdx • time • vtop |
Searching | ag • grep • whereis • which |
Shell builtins | compgen • echo • printf |
Text processing | cut • rev |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
Comments on this entry are closed.
For your own password:
passwd
For root password:
sudo passwd root
FYI, we don’t set root password on Ubuntu for security reasons. One user will be added to the ‘sudo’ group and that will act as admin user. This ensures safety as root account without password is locked and cannot be used for ssh.
Источник
How to Change Your User Password In Linux
Linux set password instructions
With the Linux operating system, it’s easy to change your user password. The easiest way to change your password is from a shell prompt. The steps below show you how to change your Linux user password and reset your Linux password.
How to Change Your Linux Password
How you change your password from the command line is accomplished with the passwd command. Don’t let the idea of the command line scare you away, as it’s incredibly simple. Here’s how to use this command:
Open a terminal window.
Issue the command passwd.
When prompted, type your current user password.
Type the new password.
Verify the password by typing it a second time.
Close the terminal window.
The password change takes effect immediately.
Linux: Reset User Password
To change someone else’s password, use the sudo command.
Open a terminal window.
Issue the command sudo passwd USERNAME (where USERNAME is the name of the user whose password you want to change).
Источник
How To Set or Change User Password In Linux?
Linux passwords are used to authenticate users. Linux passwords was hold in /etc/passwd file with other user related information like default shell, home directory path etc. Now in modern Linux distributions holds passwords in /etc/shadow file which have restricted access. This file holds user passwords as hash values with salt. Hashing and salting makes passwords more secure.
Change Current User Password
To change a user password we need password change privilege. For currently logged user we can change passwords just like below.
Change Current User Password
- passwd command will start change process for current user which is root.
- New password: is asking new password and will not be printed to the screen for security reasons.
- BAD PASSWORD is prompted because I have entered easy to crack password. For your productions systems please chose strong passwords.
- Retype new password: is asking to enter same password for second time to avoid mistakes.
- passwd: shows that password update process is completed successfully.
Change Different User Password.
To change other user password we need to be root user. We will provide the username to the passwd command in order to change user password. In this example we will change the password of user test
- This is very similar to previous password change operation.
Change Group Password
Linux operating system provides group for flexible privilege management. All users may have one or more groups. These groups also have passwords too. We can also change these password. We will use gpasswd command in order to change group password. In this example we will change the group ismail password.
Change Group Password
Источник