Logging In to a Host Without Any Passwords
Scenarios
COC allows you to use the account management function to implement password-free login to hosts. This function applies only to ECSs that run the Linux OS. You can select the target account on the password-free login module to go to the command execution page. Note that the account must meet the following conditions:
- Corresponding parameters have been configured in the account baseline.
- The current account can be found in the target host system.
Currently, password-free login is supported only in the CN North-Beijing4 region.
Precautions
Prerequisites for a successful remote login to a host:
- A UniAgent has been installed and is running on the target host. The UniAgent version must be later than 1.1.3.8.
- 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 default 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 a Host Without Any Passwords
- Log in to COC.
- In the navigation pane on the left, choose Resource O&M > Automated O&M.
- In the Routine O&M area, and click Account Management.
- Choose Accounts > By Resource or By Application.
- 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.
- Choose Password-free Login in the Operation column.
- Select the target account from the drop-down list and click OK.
The black screen command page is displayed.
Feedback
Was this page helpful?
Provide feedbackThank 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