chpasswd command in Linux with examples Last Updated : 15 May, 2019 Comments Improve Suggest changes Like Article Like Report chpasswd command is used to change password although passwd command can also do same. But it changes the password of one user at a time so for multiple users chpasswd is used. Below figure shows the use of passwd command. Using passwd we are changing the password of the guest user. Here first you have to enter the password of the currently signed user and then you change the password of any other user. One must have administrator privileges. chpasswd command reads a number of username and password which are separated by colon using standard input or file, and then encrypt as per the options. Syntax: $chpasswd user1:user1_password user2:user2_password user3:user3_password Note: After completion please press ctrl+d to exit from the command. As soon as ctrl + d is pressed password gets changed. A simple text file can also be used to store username and password and then use them to change the password. $cat > pass.txt user1:user1_password user2:user2_password user3:user3_password Then provide this to chpasswd command. $chpasswd < file_name.txt Options: -c, --crypt-method Method_Name : This command option is used for the crypt method. The method can be DES, MD5, SHA256, SHA512 or NONE. -e, --encrypted : It is used to supply the encrypted passwords. -h, --help : Used to display the command options and messages. -m, --md5 : It is used to encrypt the clear text password using the MD5 algorithm. -s, --sha-no_of_rounds : Here you can give the number of rounds for the SHA crypt algorithm. Example: The encryption algorithm can also be applied to the password. $chpasswd -c SHA512 user1:user1_password user2:user2_password user3:user3_password or $chpasswd --md5 user1:user1_password user2:user2_password user3:user3_password Note: Both are a different type of encryption algorithm Comment More infoAdvertise with us H him0000 Follow Improve Article Tags : Linux-Unix Similar Reads case command in Linux with examples The case command in Linux is an essential tool for simplifying script logic, especially when multiple if/elif conditions need to be evaluated for a single variable. It offers a more readable and efficient way to execute commands based on pattern matching, making your shell scripts easier to maintain 2 min read How to View the Content of File in Linux | cat Command The cat command in Linux is more than just a simple tool, it's a versatile companion for various file-related operations, allowing users to view, concatenate, create, copy, merge, and manipulate file contents. Let's see the details of some frequently used cat commands, understanding each example alo 7 min read cc command in Linux with Examples 'cc' command stands for C Compiler, usually an alias command to 'gcc' or 'clang'. As the name suggests, executing the 'cc' command will usually call the 'gcc' on Linux systems. It is used to compile the C language codes and create executables. The number of options available for the cc command is ve 3 min read Encrypt/Decrypt Files in Linux using Ccrypt Ccrypt is a command line tool for encryption and decryption of data. Ccrypt is based on the Rijndael cipher, the same cipher used in the AES standard. On the other hand, in the AES standard, a 128-bit block size is used, whereas ccrypt uses a 256-bit block size. Ccrypt commonly uses the .cpt file ex 3 min read How to Change the Directory in Linux | cd Command Navigating the Linux file system is like exploring a vast library; each directory (folder) holds its own collection of files and subdirectories, and knowing how to move between them efficiently is the first step to mastering the command line. The cd (Change Directory) command is your compass in this 7 min read cfdisk command in Linux with examples cfdisk command is used to create, delete, and modify partitions on a disk device. It displays or manipulates the disk partition table by providing a text-based "graphical" interface. cfdisk /dev/sda Example: After running you get a prompt like this: Choose gpt from the list. Now you will see a parti 3 min read chage command in Linux with examples The 'chage' command in Linux is a powerful tool used to manage user password expiry and account aging information. It is particularly useful in environments where user access needs to be controlled over time, such as when login access is time-bound or when itâs necessary to enforce regular password 4 min read chattr and lsattr commands in Linux with examples In the world of Linux, managing file permissions and attributes is crucial for maintaining a secure and organized system. Two powerful commands that help control file and directory attributes are 'chattr' and 'lsattr'. These commands are essential for administrators and advanced users who need to pr 8 min read chfn command in Linux with examples 'chfn' command in Linux allows you to change a user's name and other details easily. 'chfn' stands for Change finger. Basically, it is used to modify your finger information on Linux system. This information is generally stored in the file '/etc/passwd' that includes user's original name, work phone 3 min read chgrp command in Linux with Examples The `chgrp` command in Linux is used to change the group ownership of a file or directory. All files in Linux belong to an owner and a group. You can set the owner by using âchownâ command, and the group by the "chgrp" command. Syntax of `chgrp` command in Linuxchgrp [OPTION]⦠GROUP FILE⦠chgrp [OPT 3 min read Like