Articles in this section

How to configure source server to accept SSH connections and allow user root during a migration process?

kb: how-to Plesk for Linux ext: migrator ABT: Group A

Applicable to:

  • Plesk for Linux

Question

How to configure source server to accept SSH connections and allow user root during a migration process?

Answer

  • By default, SSH server is mainly configured to allow root user to log in. However, it may have been reconfigured to have root logins disabled as a security measure.

    Note: 'root' user is disabled by default on AWS instances and Ubuntu.

    1. Connect to the server via SSH.

    2. Escalate privileges to 'root':

      # sudo su -
      # whoami
      root

    3. Set password for 'root' user:

      # passwd

    4. Make sure that the configuration file /etc/ssh/sshd_config has parameters PermitRootLogin and PasswordAuthentication are set to yes and not prepended by # symbol.
      Otherwise, open /etc/ssh/sshd_config in text editor and perform the necessary changes to look as below:

      # grep -i 'permitroot' /etc/ssh/sshd_config
      PermitRootLogin yes
      # grep -i 'passwordauthentication' /etc/ssh/sshd_config
      PasswordAuthentication yes

      Note: Before making this change, make sure that the password for user root is sufficiently complex (no less than 12 characters long, including numbers, upper/lowercase letters, and special symbols). Change the password if necessary.

    5. Restart SSH server if any configuration changes have been made:

      # service sshd restart

  • If the server has a firewall, it should be configured to allow incoming SSH connections from Plesk server.

  • Review files /etc/hosts.allow and /etc/hosts.deny for any rules that may prevent access to SSH service from destination Plesk server.
    For example, if access to sshd service is denied in hosts.deny:

    CONFIG_TEXT: sshd: ALL

    CONFIG_TEXT: ALL: ALL

    Then, hosts.allow should have a record which would allow SSH access from destination server:

    CONFIG_TEXT: sshd: 192.0.2.2 192.0.2.3 : allow

    Note: Replace IP addresses above with IP address of destination server. If destination server has several IP addresses, put all of them in one line, separated by spaces.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.