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 | |
set -ex | |
firewall-cmd --permanent --add-port=53/tcp | |
firewall-cmd --permanent --add-port=53/udp | |
firewall-cmd --permanent --add-port=80/tcp | |
firewall-cmd --permanent --add-port=443/tcp | |
firewall-cmd --permanent --add-port=2376/tcp | |
firewall-cmd --permanent --add-port=2379-2380/tcp |
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 | |
set -ex | |
kubeadm reset | |
systemctl stop kubelet | |
systemctl stop docker | |
rm -rf /var/lib/cni/ |
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 | |
echo "configuring FW rules ..." | |
firewall-cmd --permanent --add-port=53/tcp | |
firewall-cmd --permanent --add-port=53/udp | |
firewall-cmd --permanent --add-port=80/tcp | |
firewall-cmd --permanent --add-port=443/tcp | |
firewall-cmd --permanent --add-port=2376/tcp | |
firewall-cmd --permanent --add-port=2379-2380/tcp | |
firewall-cmd --permanent --add-port=6443/tcp |
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 | |
yum -y update | |
yum -y install net-tools wget telnet yum-utils device-mapper-persistent-data lvm2 | |
### Add Docker repository. | |
yum-config-manager \ | |
--add-repo \ | |
https://download.docker.com/linux/centos/docker-ce.repo -y |
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
#!/usr/local/env sh | |
PORT="30022" | |
sudo sed -i "s/#Port 22/Port ${PORT}/g" /etc/ssh/sshd_config | |
sudo sed -i "s/#PermitRootLogin yes/PermitRootLogin no/g" /etc/ssh/sshd_config | |
echo ""|sudo tee -a /etc/ssh/sshd_config | |
echo "AllowUsers samuel"|sudo tee -a /etc/ssh/sshd_config | |
echo ""|sudo tee -a /etc/ssh/sshd_config |
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
host=ai | |
hostnamectl set-hostname ${host} | |
echo >> /etc/hosts | |
echo NETWORKING=yes > /etc/sysconfig/network | |
echo "HOSTNAME="`hostname` >> /etc/sysconfig/network | |
sed -i 's/SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config | |
sed -i 's/SELINUX=.*/SELINUX=disabled/g' /etc/sysconfig/selinux |
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 | |
function addSudo() { | |
sudoPwd=/etc/sudoers | |
chmod u+w $sudoPwd | |
if grep $1 $sudoPwd; then | |
echo "User $1 already have sudo!" | |
else | |
sed -i '/root[\s\t]*ALL=(ALL)/a\'${1}' ALL=(ALL) ALL' $sudoPwd \ | |
&& sed -i '/NOPASSWD/a\'${1}' ALL=(ALL) NOPASSWD: ALL' $sudoPwd \ | |
&& echo "User $1 add sudo success!" |
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
[root@rhel7 ~]# firewall-cmd --list-all |grep ports | |
ports: 443/tcp 80/tcp | |
forward-ports: |
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
[root@rhel7 ~]# firewall-cmd --permanent --add-port=80/tcp | |
success | |
[root@rhel7 ~]# firewall-cmd --permanent --add-port=443/tcp | |
success |
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
[root@rhel7 ~]# firewall-cmd --permanent --list-all | |
public (default) | |
interfaces: | |
sources: | |
services: dhcpv6-client ssh | |
ports: 443/tcp 80/tcp | |
masquerade: no | |
forward-ports: | |
icmp-blocks: | |
rich rules: |