Logging In to an ECS Without a Password
During routine cloud O&M, O&M personnel often need to log in to different types of Linux ECSs to run commands. However, each login requires a password, which is inefficient and may increase security risks due to frequent password input. To address this challenge, COC supports password-free login to hosts through the account management function. When performing operations, you can select the target account in the password-free login module and directly access the host command execution page without entering the password again. This greatly improves O&M efficiency and security.
Prerequisites
Note that the account must meet the following conditions:
- This parameter has been configured in Creating an Account Baseline.
- The current account can be found in the target host system.
Constraints
- Password-free login is supported only in CN North-Beijing4 and CN North3.
- Currently, this function applies only to Linux hosts of the ECS type.
Precautions
Prerequisites for a successful remote login to a host:
- UniAgent has been installed and is running on the target host. The UniAgent version must be later than or equal to 1.1.6.
- The host is in the running state.
- Accounts configured in the baseline or imported accounts can be found on the target host.
- The account has a home directory. The preset directory is /home/account name.
If an account does not have a home directory, run the following command to create a home directory so that the password-free login function can be used.
Assume that the username is user1.
- Create a directory. (-p ensures that the parent directory is available. If the /home directory cannot be found, it will be automatically created.)
sudo mkdir -p /home/user1
- Copy all default configurations (including hidden files).
sudo cp -r /etc/skel/. /home/user1/
- Use the recursive function to change the owner and group of the /home/user1 directory and all its subdirectories and files to user user1 and group user1.
sudo chown -R user1:user1 /home/user1
- Set the permission to 700, that indicates only the owner has the permission.
sudo chmod 700 /home/user1
- The -d option specifies the new home directory path.
sudo usermod -d /home/user1 user1
- Create a directory. (-p ensures that the parent directory is available. If the /home directory cannot be found, it will be automatically created.)
Logging In to an ECS Without a Password
- Log in to COC.
- In the navigation pane, choose Resource O&M > Automated O&M.
- In the Routine O&M area, click Account Management. The Account Management page is displayed.
- Access the Accounts > By Resource or Accounts > By Application tab page.
- By Resource applies to all purchased host instances.
- By Application applies to purchased hosts that have been bound to an application. If you select By Application, you need to select the target application or component.
- Select a resource type.
By default, Elastic Cloud Server (ECS) is selected.
- In the account list, locate the target host account and choose More > Login Without Password in the Operation column. Figure 1 Logging In to an ECS Without a Password
- Select the target account from the drop-down list and click OK.
The page for executing commands on the host is displayed.
Figure 2 Selecting a login account
Figure 3 Logging In to an ECS without a password
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot