Last active
July 5, 2024 10:07
-
-
Save ntheanh201/b200d56c23d749cb18c80cfaa173e1d1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum provides /usr/sbin/semanage | |
# CentOS 7 | |
yum install -y policycoreutils-python-2.5-34.el7.x86_64 | |
# CentOS/Rocky Linux 8 | |
yum install -y policycoreutils-python-utils | |
semanage port -l | grep 9091 | |
sudo semanage port -a -t ssh_port_t -p tcp 9091 | |
vim /etc/ssh/sshd_config | |
# update Port to 9091 | |
systemctl restart sshd | |
journalctl -u sshd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Change hostname permanent GCP: | |
rm -rf /etc/dhcp/dhclient.d/google_hostname.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo yum provides /usr/sbin/semanage | |
sudo yum install -y policycoreutils-python-2.5-34.el7.x86_64 | |
sudo semanage port -a -t ssh_port_t -p tcp 9091 | |
sudo sed -i 's/#Port 22/Port 9091/' /etc/ssh/sshd_config | |
sudo systemctl restart sshd | |
sudo journalctl -u sshd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#!/bin/bash
sudo yum provides /usr/sbin/semanage
sudo yum install -y policycoreutils-python-utils
sudo semanage port -a -t ssh_port_t -p tcp 9091
sudo sed -i 's/#Port 22/Port 9091/' /etc/ssh/sshd_config
sudo systemctl restart sshd
sudo journalctl -u sshd