{"id":57808,"date":"2021-12-20T11:24:00","date_gmt":"2021-12-20T16:24:00","guid":{"rendered":"https:\/\/jumpcloud.com\/?p=57808"},"modified":"2024-12-17T15:31:28","modified_gmt":"2024-12-17T20:31:28","slug":"how-to-manage-user-passwords-on-linux-machines","status":"publish","type":"post","link":"https:\/\/jumpcloud.com\/blog\/how-to-manage-user-passwords-on-linux-machines","title":{"rendered":"How to Manage User Passwords on Linux Machines"},"content":{"rendered":"\n
Editor’s note: this article is intended to provide general direction on how one might manage user passwords on a Linux device and does not suggest the means by which JumpCloud handles these types of administrative and security tasks. For more information about how JumpCloud helps IT admins manage passwords across any operating system, check out this Help Center article<\/a>. <\/em><\/p>\n\n\n\n Using a password with an associated user account is the primary method of authentication in Linux and most UNIX systems. It\u2019s one of the few authentication methods supported by the SSH protocol<\/a> besides public key authentication, which requires admins to create a key pair<\/a> (public and private key) to authenticate a user with a remote system.\u00a0<\/p>\n\n\n\n However, unlike public key authentication, passwords are prone to breaches such as brute force attacks that can be executed using automated scripts. Passwords can also be forgotten which means that users get locked out of the system. Weak and easily guessable passwords such as \u201cPassword123\u201d can also present a security risk, and are often a consequence of password fatigue<\/a>.<\/p>\n\n\n\n Password management is, therefore, one of the top-of-mind tasks that any system administrator should carry out. This tutorial sheds light on some of the ways you can manage passwords on a Linux system.<\/p>\n\n\n\n One of the commands used in managing passwords is the Linux passwd<\/kbd> command. The command can be used to perform a wide range of password management operations. Let\u2019s have a glance at some of the operations you can carry out using the passwd<\/kbd> command.<\/p>\n\n\n\n On Debian\/Ubuntu systems, the adduser<\/kbd> command walks you through the creation of a new login user. It allows you to specify the username and password, alongside other details. For some Linux flavors such as CentOS, RHEL, and Fedora, you need to invoke the passwd<\/kbd> command to specify the user\u2019s password.<\/p>\n\n\n\n The syntax for creating or changing a password takes the following format:<\/p>\n\n\n\n If you are logged in as a sudo user, you need to invoke sudo<\/kbd> before the command as follows:<\/p>\n\n\n\n Suppose you have a user called jack<\/kbd>. To change the user\u2019s password simply execute the command:<\/p>\n\n\n\n
\n\n\n\nManage Passwords Using the passwd<\/kbd> Command<\/h2>\n\n\n\n
Create or Change User Passwords<\/h3>\n\n\n\n
# passwd username<\/code><\/p>\n\n\n\n
$ sudo passwd username<\/code><\/p>\n\n\n\n
$ sudo passwd jack<\/code><\/p>\n\n\n\n