Help Center/ Cloud Operations Center/ User Guide/ Automated O&M/ Account Management/ Logging In to a Host Without Any Passwords
Updated on 2025-09-11 GMT+08:00

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

Logging In to a Host Without Any Passwords

  1. Log in to COC.
  2. In the navigation pane on the left, choose Resource O&M > Automated O&M.
  3. In the Routine O&M area, and click Account Management.
  4. 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.

  5. Select a resource type.

    By default, Elastic Cloud Server (ECS) is selected.

  6. Choose Password-free Login in the Operation column.
  7. Select the target account from the drop-down list and click OK.

    The black screen command page is displayed.