![]() ![]() It can be used to change a user’s password in one command line too. ![]() Only for cases where this is okay, you may consider using the method here.Ĭhpasswd is a nice tool to change a batch of accounts’ passwords in one Linux box. You must be aware that the full command line can be viewed by all users in the Linux system and the password in the command line can be potentially leased. If you want to update your own password as a normal user, you may use $ echo -e "your_current_pass\nlinuxpassword\nlinuxpassword" | passwd Additional: Reset Any Windows Password by Using Rescuer (If tips mentioned above. 'useradd newuser echo -e "passwdofuser\npasswdofuser" | passwd newuser' How to use Command Prompt to reset a forgotten password in Windows 10. Ssh 10.1.0.$i 'echo -e "linuxpassword\nlinuxpassword" | passwd linuxuser' \Įven further, we can create one user and set its initial password remotely by: # ssh remoteserver \ For example, we can change the password of linuxuser on a batch of servers (100 servers: 10.1.0.1 to 10.1.0.100) by: # for ((i=1 i<=100 i++)) do \ c when used with expect command prefaces a command to be executed before any other command, expect password: will look for the prompt for the password, send 'MYPassword\r' will send the password when prompted (add \r after you enter your password) This can also be used in a script, for example, /usr/bin/expect -f. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |