< \/dev\/urandom tr -dc A-Za-z0-9 | head -c14; echo<\/pre>\nThis will generate 14 characters random string which you can use as your new password. Feel free to edit the commands accordingly if you want the password to consists of more characters.<\/p>\n
How to change the password for a different user in Linux<\/h2>\n As we mentioned earlier in this blog post, you can only change the password for a different user if you are logged in as root or if your system user has sudo privileges. If you are logged in as root you should run the following command in the terminal:<\/p>\n
passwd user1<\/pre>\nReplace user1<\/code> with the name of the user that you want to change its password. When you are changing the password for a different user as root, you don’t have to specify the old password, and the output after successful password change should look like the one below:<\/p>\n[root@vps \/]# passwd user1\r\nChanging password for user user1.\r\nNew password:\r\nRetype new password:\r\npasswd: all authentication tokens updated successfully.\r\n<\/pre>\nIf the user that you are currently logged in as has sudo privileges and you want to change the password for a different user, you must use sudo<\/code> in your command:<\/p>\nsudo passwd user1<\/pre>\nIn our example below, we are logged in as sudouser<\/code>, and we are changing the password for user user1<\/code>:<\/p>\n[sudouser@vps \/]$ sudo passwd user1\r\n\r\nWe trust you have received the usual lecture from the local System\r\nAdministrator. It usually boils down to these three things:\r\n\r\n #1) Respect the privacy of others.\r\n #2) Think before you type.\r\n #3) With great power comes great responsibility.\r\n\r\n[sudo] password for sudouser:\r\nChanging password for user user1.\r\nNew password:\r\nRetype new password:\r\npasswd: all authentication tokens updated successfully.\r\n<\/pre>\nFirst, you will be prompted to enter the password of your current user to verify that you have sudo privileges and once the verification is successful you will be asked to enter the new password for the other user.<\/p>\n
Again, make sure that you are using a strong password for all your users because using a weak password for some of your system users will put the other users at huge risk.<\/p>\n
\n Of course, you don\u2019t have change user password in Linux<\/strong>, if you use one of our Linux VPS Hosting<\/a> services, in which case you can simply ask our expert Linux admins to change the user password in Linux for you. They are available 24\u00d77 and will take care of your request immediately.<\/p>\nPS<\/strong><\/span>. If you liked this post on changing user password in Linux<\/strong>, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":"We will show you how to change user password in Linux. Changing user passwords in Linux could be one of … <\/p>\n
Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":28723,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2071,13],"tags":[1759,27,1760],"yoast_head":"\nHow to Change User Password in Linux - RoseHosting<\/title>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n \n \n \n \n \n\t \n\t \n\t \n