Question
How do you reset OnApp password via command line?
Environment
OnApp 5.x
Answer
- Log in to OnApp Cloud Control Panel using SSH:
ssh root@your.hostname
- Go to the directory where your Control Panel is installed:
cd /onapp/interface
- To generate a random password, run the following rake task:
rake onapp:password[admin_login]
- To set a predefined password, run:
rake onapp:password[admin_login,new_password]
Make sure there are no spaces in brackets. Upon success, you will get a “Password successfully changed to 'new_password'” message. If the operation could not be completed, you will get the list of errors.
Examples:
# rake onapp:password[onappsupport] [2014-07-16 14:41:45 -0400] Password successfully changed to 'CyYEkRSbOio1' # rake onapp:password[onappsupport,6ka1ljm2en4gy7tws5f3] [2014-07-16 14:45:28 -0400] Password successfully changed to '6ka1ljm2en4gy7tws5f3'
*Note, the command with a new unencrypted password will be left in history file. For security reason, It is recommended to clear command history.
Comments
1 comment
If your password contains special characters, they may be interpreted by bash instead of passed to the rake task. If you surround the password by single quotes ( ' ), this problem can be avoided.
e.g.
rake onapp:password[onappsupport,'6ka1ljm2en4gy7tws5f3!']
Please sign in to leave a comment.