Enable SSH on CentOS 7: Step-by-Step Guide
To enable SSH remote login on CentOS 7, you can follow the steps below:
- Make sure your CentOS 7 system has the SSH server installed. If it is not installed, you can use the following command to install the OpenSSH server:
sudo yum install openssh-server
- Start the SSH service and set it to automatically start at system boot.
sudo systemctl start sshd
sudo systemctl enable sshd
- Ensure that the firewall allows SSH connections. You can run the following command to add a rule that allows SSH traffic through the firewall:
sudo firewall-cmd --zone=public --add-service=ssh --permanent
sudo firewall-cmd --reload
- Ensure that SELinux allows SSH connections. You can run the following command to modify the SELinux policy to allow SSH connections:
sudo setsebool -P ssh_sys_admin on
- Make sure you are aware of the IP address of your CentOS 7 system. You can use the following command to view the system’s IP address:
ip addr show
Now, you should be able to connect to your CentOS 7 system using an SSH client. You can use the following command:
ssh username@ip_address
Please note that “username” refers to your username on the CentOS system, and “ip_address” is the IP address of your CentOS system. Once connected successfully, you will need to enter a password for authentication.