System name | Steps to change the logon password |
Linux | On a Linux server, run the passwd <UserName> command to change a user's logon password. After you run the command, enter the new password as prompted. If you do not specify <UserName>, the password for the current user is changed. |
Windows | This section uses Windows Server 2019 as an example to show how to change a user's logon password. Log on to the Windows server and click the icon in the lower-left corner. Click the icon. On the Windows Settings page, click Accounts. In the navigation pane on the left, click Sign-in options. Change the server password as prompted on the page.
|
MySQL database | Log on to the MySQL database. Run the following command to view user password information in the database. SELECT user, host, authentication_string FROM user;
Note Some MySQL database versions may not support the preceding command. If you run the command and do not get user password information, run the following command instead. SELECT user, host, password FROM user;
Run the following command to change the password for a specific user based on the query results and the weak password alert. SET PASSWORD FOR '<UserName>'@'<HostName>' = PASSWORD('<NewPassword>');
Run the refresh command: flush privileges;.
|
Redis database | Open the Redis database configuration file, redis.conf. Run the following command to change or add a password. requirepass <NewPassword>;
If a logon password already exists, this command changes it. If no logon password exists, this command adds a new one. Restart the Redis service.
|
SQL Server database | Linux system logon Log on to the SQL Server database and run the following command to change the logon password. exec sp_password <OldPassWord>,<NewPassword>,<UserName>
Windows authentication logon In the SQL Server database client, choose , select the user, and change the weak password to a complex password.
|
MongoDB database | Log on to the MongoDB database. Run the use admin command to switch to the admin user. Run the db.changeUserPassword("<UserName>", "<NewPassword>") command to change the database logon name and password. Set a strong password that is more than 12 characters long and includes digits, uppercase letters, lowercase letters, and special characters. Ensure that the identity authentication feature is enabled. In the MongoDB configuration file mongod.conf, set security.authorization to enabled or set the auth configuration item to true. Run the systemctl restart mongod command to restart the MongoDB service.
|
PostgreSQL database | Log on to the PostgreSQL database. Run the following command to change the weak password. ALTER USER <UserName> WITH PASSWORD <NewPassword>;
|
Tomcat | Open the configuration file conf/tomcat-user.xml in the Tomcat root directory. Change the value of the password property for the user node to a complex password.
|
Rsync | Open the Rsync configuration file, rsyncd.conf. Find the secrets file configuration item and locate the path of the rsyncd.secret file within it. Edit the rsyncd.secret file in the <UserName>:<NewPassword> format to change the password for the corresponding user to a new, complex password. Restart the Rsync service.
|
SVN | Open the repository directory. In the configuration file <path>/conf/svnserve.conf, find password-db. Use the password-db configuration to find the password file path, and then change the password in that file to the specified password. The default file is `passwd`. Restart the SVN service.
|
vsftpd server software | Local user Open the configuration file vsftpd.conf. Add or change the value of the anonymous_enable configuration item to NO to disable anonymous logon. Run the passwd <UserName> command to change the FTP user's password. Follow the prompts to set a new, complex password that meets the requirements.
Virtual user Open the file /etc/vsftpd/login.txt. Change the password for the corresponding username and save the file. The file format is as follows: the first line is User A's username, the second line is User A's password, the third line is User B's username, the fourth line is User B's password, and so on. Run the db_load -T -t hash -f /etc/vsftpd/login.txt /etc/vsftpd/login.db command. Modify the /etc/pam.d/vsftpd file. Add the statement db=/etc/vsftpd/login after the lines that contain auth pam_userdb.so and account pam_userdb.so. Save the file after the changes. The following figure shows the location. Restart vsftpd.
|
FTP | Log on to the target Linux server as the root user. Run the following command. passwd ftp <UserName>
Enter the new password as prompted. After the password is changed successfully, the message all authentication tokens updated successfully appears.
|
InfluxDB database | Log on to the InfluxDB database. Run the following command to change the database password. Replace NewPassword with the new password. The new password must be enclosed in single-byte single quotation marks. set password for "<UserName>" = "<NewPassword>"
|
JBoss 6 and 7 | JBoss 6: Edit the configuration file /conf/props/jmx-console-users.properties and change the weak password. The format after modification is <UserName> =<Password>. Restart JBoss 6. Run ps -ef|grep jboss to view the current JBoss 6 process. Run kill -9 <ProcessID> to stop the process. Replace <ProcessID> with the process ID of JBoss 6. Run the following command to start the JBoss service. Replace jboss6_path with the installation directory of JBoss 6. jboss6_path/bin/run.sh
JBoss 7: Edit the configuration file /configuration/mgmt-users.properties and delete the user entry that has a weak password. Run bin/adduser.sh in the JBoss installation path and follow the prompts to add a new user with a complex password.
|
Jenkins | Log on to the Jenkins service web console. Click Configure to go to the Configure page. In the Password field, enter a new password.
|
OpenLDAP | Run the following command to query the value and location of the OpenLDAP administrator password field. ldapsearch -H ldapi:// -LLL -Q -Y EXTERNAL -b "cn=config" "(olcRootDN=*)" dn olcRootDN olcRootPW
Run the following command to generate a new password. slappasswd -s <NewPassword>
After running this command, you will get the hash value of the new password, NewHash. Create a new file named newpassword.ldif and add the following information to it. dn: olcDatabase={2}hdb,cn=config changetype: modify replace: olcRootPW olcRootPW: NewHash
The content of the `dn` line is the `dn` value returned by the first query command, and `NewHash` is the hash value of the new password. Run the following command to import the new ldif file. ldapmodify -H ldapi:// -Y EXTERNAL -f newpasswd.ldif
|
OpenVPN on Linux | Edit the configuration file pwd-file to change the OpenVPN password. The procedure is as follows: Find the configuration file pwd-file. The file is usually in the /etc/openvpn directory. Add the following statement to the configuration file to cancel client certificate authentication. client-cert-not-required
Add the following statement to the configuration file to enable the user password script. auth-user-pass-verify /etc/openvpn/checkpsw.sh via-env
Add the following statement to the configuration file to block system alerts. script-security system
Edit the /etc/openvpn/psw-file file. Each line corresponds to one account, with the username and password separated by a space. Example: cat /etc/openvpn/psw-file
abcdocker <NewPassWord>
abc <NewPassWord>
test <NewPassWord>
Run the following command to get the checkpsw.sh script. wget http://openvpn.se/files/other/checkpsw.sh
Note By default, checkpsw.sh reads usernames and passwords from the file /etc/openvpn/psw-file.
|
Oracle database | Log on to the Oracle database. Run the following command to change the password. alter user <UserName> identified by <NewPassWord>;
|
pptpd service | Edit the /etc/ppp/chap-secrets file. Configure the username and password in the format <UserName> pptpd <NewPassword>. Use a tab key to separate UserName, pptpd, and NewPassword. Restart the pptp service.
|
ProFTPD | Run the following command and enter the new password as prompted. In the command, File_Path refers to the file path where the virtual user is stored. ftpasswd --passwd --name=<UserName> --change-password --file=File_Path
|
RabbitMQ | Run the following command to change the weak password. rabbitmqctl change_password <UserName> '<NewPassword>'
|
VncServer | Ensure that VncServer is shut down, then go to the VncServer installation directory on the VncServer server. If the weak password is not for the root user, log on or switch to the user whose password you want to change after entering the installation directory. For example, if the user is `aliuser`, run su - aliuser. Delete the `passwd` file in the installation directory, for example, delete /home/aliuser/.vnc/passwd. Run the vncpasswd command to reset the password.
Important VncServer passwords are truncated to the first 8 characters. For example, if you set the new password to `Aliyunpasswd`, the effective password is `Aliyunpa`. If the effective password does not meet the complexity requirements, it is at high risk of being cracked. Ensure your password meets the complexity requirements.
|
WebLogic 12c | Log on to the WebLogic Server Administration Console. In the navigation pane on the left, choose . Select the user whose password you want to change. On the Passwords page, enter and confirm the new password, then click Save. If Activate Changes is displayed in the Change Center in the upper-left corner of the console, click Activate Changes. Log on to the server and modify the password field for the target user in the configuration file `%DOMAIN_HOME%/servers/AdminServer/security/boot.properties. The password modified here must be the same as in the WebLogic console. After the password is changed, it will be automatically encrypted with AES. Run the %DOMAIN_HOME%/bin/stopWeblogic.sh command to safely stop WebLogic, and then restart it.
Note You must restart WebLogic for the new password to take effect. If you cannot modify the configuration, click Lock & Edit in the Change Center in the upper-left corner of the WebLogic console to modify the configuration. You must stop WebLogic safely. Otherwise, WebLogic may fail to start.
|
ActiveMQ | Go to the configuration file directory activemq_path/conf/. activemq_path is the application installation path. Run the vim jetty-realm.properties command to edit the configuration file. Add or modify a user. The format for changing the username and password is <UserName>: <NewPassword>,RoleName, where RoleName is the role. For example: admin: passwd123!@#, admin. After making the changes, save, exit, and restart the service.
|
Elasticsearch service |
Note Install the X-Pack plugin using Elasticsearch's security policy. Elasticsearch 7.X and later versions have the X-Pack plugin built-in. For versions earlier than 7.X, you need to enable the X-Pack configuration. In the elasticsearch.yml file, change the configuration to xpack.security.enabled: true. Run the following command to change a user's password. In the command, ES_HOME_PATH is the installation path of Elasticsearch, and passwd is the new password. ES_HOME_PATH/bin/elasticsearch-users passwd <UserName>
|
Samba | Run the smbpasswd <UserName> command to change the user's password. Enter the new password as prompted.
|
Zabbix | Log on to the Zabbix web management console with an administrator account. In the top menu bar, choose to view the user list. Click the target username, then click Change password. Enter the new password and click Update.
|