December 2018
Beginner
826 pages
22h 54m
English
First, we're going to make a copy of our initial configuration file:
[vagrant@centos2 ~]$ sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config_2020
Then, we're going to make a couple of changes:
[vagrant@centos2 ~]$ sudo sed -i 's#\#Port 22#Port 2020#g' /etc/ssh/sshd_config_2020[vagrant@centos2 ~]$ sudo sed -i 's#\#PidFile /var/run/sshd.pid#PidFile /var/run/sshd_2020.pid#g' /etc/ssh/sshd_config_2020
Now, we're going to copy our systemd unit file:
[vagrant@centos2 ~]$ sudo cp /usr/lib/systemd/system/sshd.service /etc/systemd/system/sshd_2020.service
Then, we're going to make some changes here:
[vagrant@centos2 ~]$ sudo sed -i 's#OpenSSH server daemon#OpenSSH server daemon on port 2020#g' /etc/systemd/system/sshd_2020.service ...
Read now
Unlock full access