Enabling the root option in SSH within an OpenVZ container involves modifying the SSH daemon configuration. It’s important to note that permitting root SSH login can be potentially harmful due to security risks, as it opens potential for brute force login attacks on the root user account by hackers.
Here are the steps:
1. Access the OpenVZ container.
1. Locate the SSH Daemon configuration file. This is usually located in /etc/ssh/. You can open it with a text editor by typing:
\`\`\` sudo nano /etc/ssh/sshd\_config \`\`\`1. Scroll through the file and look for a line that reads `#PermitRootLogin`. The “#” at the start of a line implies that the line is commented out.
1. Uncomment this line by removing the “#” symbol and change it to `PermitRootLogin yes`.
1. If there’s no such line, then scroll to the bottom of the file and add `PermitRootLogin yes`.
1. Still with the SSHD configuration file open, find a line that starts with `#PasswordAuthentication`. Again, remove the “#” symbol. Make sure it reads `PasswordAuthentication yes`. If it’s not there, add it to the bottom of the file.
1. Save and close the SSHD configuration file.
1. Now, restart the SSH daemon for the changes to take effect. Depending on your OpenVZ version, one of these commands should work:
\`\`\`shell service ssh restart \`\`\` or \`\`\`shell /etc/init.d/sshd restart \`\`\`After these changes, root user is permitted to log in via SSH in your OpenVZ container. Be sure your root password is very strong and consider using authentication keys in addition to or instead of password logins.