Install and Configure SSH Server on Linux
Update: 3 Aug 2018
We have included additional systemd command and also command to install ssh in Fedora
We are using Ubuntu 18.04 LTS Workstation, SSH was not installed by default. Use the following command to install OpenSSH server:
We have included additional systemd command and also command to install ssh in Fedora
Install SSH on Ubuntu
We are using Ubuntu 18.04 LTS Workstation, SSH was not installed by default. Use the following command to install OpenSSH server:
Update System
We need to update the system before starting to install SSH server. use the command below:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get upgrade
Install OpenSSH Server
To install OpenSSH server use the command below:
sudo apt install -y openssh-server
Install SSH on Fedora
Update System
Before installation, perform a system update first:
sudo dnf update
Install OpenSSH Server
To install OpenSSH server use the command below:
sudo dnf install -y openssh-server
Configure SSH with Systemd
Check SSH Services
To check if ssh daemon is running, use the command:
sudo systemctl status sshd
Starting SSH
To start the service use the command below:
sudo systemctl start sshd
Configure SSH Server
If we need to change any settings such as port number, use any favorite editor vi, vim or nano with the following command:
sudo nano /etc/ssh/sshd_config
Once the config file is open, make the changes you want. Then we need to restart the service.
Restart SSH Daemon
To restart ssh daemon, use the command:
Restart SSH Daemon
To restart ssh daemon, use the command:
sudo systemctl restart sshd.service
Check if SSH Server Runs on Boot
To check is SSH daemon runs on boot use the command:
sudo systemctl is-enabled sshd.service
If it is disabled, we need to enable it so that the daemon will start when system boots up.
Set SSH Daemon to Run on Boot
To enable the daemon so that it start when system boots up, use the command:
sudo systemctl enable sshd.service
Test SSH
To test if the ssh is working, go to a remote workstation and use the following command:
ssh username@serverIpAddress
If you are using different port number please use the following command:
We should be able to login to the server.
ssh username@serverip -p <port_numbrt>
We should be able to login to the server.
Reference
For details of configuration please refer to the following guide:
***
Comments
Post a Comment