How to configure source server to accept SSH connections and allow user root during a migration process? - Support Cases from Plesk Knowledge Base (2024)

Knowledge Base

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:

    sshd: ALL

    ALL: ALL

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

    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.

Knowledge Base

Hosting Wiki

How to configure source server to accept SSH connections and allow user root during a migration process? - Support Cases from Plesk Knowledge Base (2024)

FAQs

How to configure source server to accept SSH connections and allow user root during a migration process? - Support Cases from Plesk Knowledge Base? ›

The usermod command adds users to the root group and provides root privileges. It allows you to modify user account details, including group membership. The useradd command with appropriate options can create a new user account and assign it to the root group during user creation, effectively granting root privileges.

How do I give a user root permission? ›

The usermod command adds users to the root group and provides root privileges. It allows you to modify user account details, including group membership. The useradd command with appropriate options can create a new user account and assign it to the root group during user creation, effectively granting root privileges.

How does SSH allow users to authenticate servers? ›

SSH keys are a matching set of cryptographic keys which can be used for authentication. Each set contains a public and a private key. The public key can be shared freely without concern, while the private key must be vigilantly guarded and never exposed to anyone.

How to configure SSH configuration file? ›

The SSH config file is divided into Host sections with specific configuration options for every host. The argument is the exact hostname, IP address, or a match pattern. Use whitespace as a separator between parameters and arguments or an equals sign ( = ).

Where to find SSH config? ›

The ssh program on a host receives its configuration from either the command line or from configuration files ~/.ssh/config and /etc/ssh/ssh_config .

How to configure SSH for remote access? ›

To initiate an SSH connection to a remote system, you need the Internet Protocol (IP) address or hostname of the remote server and a valid username. You can connect using a password or a private and public key pair. Because passwords and usernames can be brute-forced, it's recommended to use SSH keys.

What is SSH root access? ›

SSH Access To Root Account

SSH (Secure Shell) is often used for logging into remote servers as root. However, the default configuration in OpenSSH prevents root login using passwords. To enable root login, change the value of the PermitRootLogin configuration option in /ssh/sshd_config.

Top Articles
Latest Posts
Article information

Author: Catherine Tremblay

Last Updated:

Views: 5891

Rating: 4.7 / 5 (67 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Catherine Tremblay

Birthday: 1999-09-23

Address: Suite 461 73643 Sherril Loaf, Dickinsonland, AZ 47941-2379

Phone: +2678139151039

Job: International Administration Supervisor

Hobby: Dowsing, Snowboarding, Rowing, Beekeeping, Calligraphy, Shooting, Air sports

Introduction: My name is Catherine Tremblay, I am a precious, perfect, tasty, enthusiastic, inexpensive, vast, kind person who loves writing and wants to share my knowledge and understanding with you.