最后的话
最近很多小伙伴找我要Linux学习资料,于是我翻箱倒柜,整理了一些优质资源,涵盖视频、电子书、PPT等共享给大家!
资料预览
给大家整理的视频资料:
给大家整理的电子书资料:
如果本文对你有帮助,欢迎点赞、收藏、转发给朋友,让我有持续创作的动力!
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
执行上述命令可以在文件 /etc/sysconfig/iptables 中看到配置
以下提供一个干净的配置脚本:
/sbin/iptables -P INPUT ACCEPT
/sbin/iptables -F
/sbin/iptables -X
/sbin/iptables -Z
/sbin/iptables -A INPUT -i lo -j ACCEPT
/sbin/iptables -A INPUT -p tcp --dport 22 -j ACCEPT
/sbin/iptables -A INPUT -p tcp --dport 80 -j ACCEPT
/sbin/iptables -A INPUT -p tcp -s 10.241.121.15 -j ACCEPT
/sbin/iptables -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
/sbin/iptables -A INPUT -m state --state ESTABLISHED -j ACCEPT
/sbin/iptables -P INPUT DROP
最后执行 service iptables save ,先确保ssh连接没有问题,防止规则错误,导致无法连上服务器,因为没有save,重启服务器规则都失效,否则就只有去机房才能修改规则了。也可以参考:ubuntu iptables 配置脚本来写一个脚本。
最后再次提醒,在清空规则之前一定要小心,确保Chain INPUT (policy ACCEPT)。
**补充阿里云的linux\_drop\_port.sh**
#!/bin/bash
#########################################
#Function: linux drop port
#Usage: bash linux_drop_port.sh
#Author: Customer Service Department
#Company: Alibaba Cloud Computing
#Version: 2.0
#########################################
check_os_release()
{
while true
do
os_release=
(
g
r
e
p
"
R
e
d
H
a
t
E
n
t
e
r
p
r
i
s
e
L
i
n
u
x
S
e
r
v
e
r
r
e
l
e
a
s
e
"
/
e
t
c
/
i
s
s
u
e
2
>
/
d
e
v
/
n
u
l
l
)
o
s
r
e
l
e
a
s
e
2
=
(grep "Red Hat Enterprise Linux Server release"/etc/issue 2>/dev/null) os_release_2=
(grep"RedHatEnterpriseLinuxServerrelease"/etc/issue2>/dev/null)osrelease2=(grep “Red Hat Enterprise Linux Server release”/etc/redhat-release 2>/dev/null)
if [ “KaTeX parse error: Expected 'EOF', got '&' at position 15: os_release" ] &̲& [ "os_release_2” ]
then
if echo “KaTeX parse error: Expected 'EOF', got '&' at position 42: …5" >/dev/null2>&̲1 then os_r…os_release”
elif echo “KaTeX parse error: Expected 'EOF', got '&' at position 42: …6">/dev/null 2>&̲1 then os_r…os_release”
else
os_release=“”
echo “
o
s
r
e
l
e
a
s
e
"
f
i
b
r
e
a
k
f
i
o
s
r
e
l
e
a
s
e
=
os_release" fi break fi os_release=
osrelease"fibreakfiosrelease=(grep “Aliyun Linux release” /etc/issue2>/dev/null)
os_release_2=
(
g
r
e
p
"
A
l
i
y
u
n
L
i
n
u
x
r
e
l
e
a
s
e
"
/
e
t
c
/
a
l
i
y
u
n
−
r
e
l
e
a
s
e
2
>
/
d
e
v
/
n
u
l
l
)
i
f
[
"
(grep "Aliyun Linux release" /etc/aliyun-release2>/dev/null) if [ "
(grep"AliyunLinuxrelease"/etc/aliyun−release2>/dev/null)if["os_release” ] && [ “
o
s
r
e
l
e
a
s
e
2
"
]
t
h
e
n
i
f
e
c
h
o
"
os_release_2" ] then if echo "
osrelease2"]thenifecho"os_release”|grep “release 5” >/dev/null2>&1
then
os_release=aliyun5
echo “
o
s
r
e
l
e
a
s
e
"
e
l
i
f
e
c
h
o
"
os_release" elif echo "
osrelease"elifecho"os_release”|grep “release 6”>/dev/null 2>&1
then
os_release=aliyun6
echo “
o
s
r
e
l
e
a
s
e
"
e
l
s
e
o
s
r
e
l
e
a
s
e
=
"
"
e
c
h
o
"
os_release" else os_release="" echo "
osrelease"elseosrelease=""echo"os_release”
fi
break
fi
os_release=
(
g
r
e
p
"
C
e
n
t
O
S
r
e
l
e
a
s
e
"
/
e
t
c
/
i
s
s
u
e
2
>
/
d
e
v
/
n
u
l
l
)
o
s
r
e
l
e
a
s
e
2
=
(grep "CentOS release" /etc/issue 2>/dev/null) os_release_2=
(grep"CentOSrelease"/etc/issue2>/dev/null)osrelease2=(grep “CentOS release” /etc/*release2>/dev/null)
if [ “KaTeX parse error: Expected 'EOF', got '&' at position 15: os_release" ] &̲& [ "os_release_2” ]
then
if echo “KaTeX parse error: Expected 'EOF', got '&' at position 42: …5" >/dev/null2>&̲1 then os_r…os_release”
elif echo “KaTeX parse error: Expected 'EOF', got '&' at position 42: …6">/dev/null 2>&̲1 then os_r…os_release”
else
os_release=“”
echo “
o
s
r
e
l
e
a
s
e
"
f
i
b
r
e
a
k
f
i
o
s
r
e
l
e
a
s
e
=
os_release" fi break fi os_release=
osrelease"fibreakfiosrelease=(grep -i “ubuntu” /etc/issue 2>/dev/null)
os_release_2=
(
g
r
e
p
−
i
"
u
b
u
n
t
u
"
/
e
t
c
/
l
s
b
−
r
e
l
e
a
s
e
2
>
/
d
e
v
/
n
u
l
l
)
i
f
[
"
(grep -i "ubuntu" /etc/lsb-release2>/dev/null) if [ "
(grep−i"ubuntu"/etc/lsb−release2>/dev/null)if["os_release” ] && [ “
o
s
r
e
l
e
a
s
e
2
"
]
t
h
e
n
i
f
e
c
h
o
"
os_release_2" ] then if echo "
osrelease2"]thenifecho"os_release”|grep “Ubuntu 10” >/dev/null2>&1
then
os_release=ubuntu10
echo “
o
s
r
e
l
e
a
s
e
"
e
l
i
f
e
c
h
o
"
os_release" elif echo "
osrelease"elifecho"os_release”|grep “Ubuntu 12.04”>/dev/null 2>&1
then
os_release=ubuntu1204
echo “
o
s
r
e
l
e
a
s
e
"
e
l
i
f
e
c
h
o
"
os_release" elif echo "
osrelease"elifecho"os_release”|grep “Ubuntu 12.10”>/dev/null 2>&1
then
os_release=ubuntu1210
echo “
o
s
r
e
l
e
a
s
e
"
e
l
s
e
o
s
r
e
l
e
a
s
e
=
"
"
e
c
h
o
"
os_release" else os_release="" echo "
osrelease"elseosrelease=""echo"os_release”
fi
break
fi
os_release=
(
g
r
e
p
−
i
"
d
e
b
i
a
n
"
/
e
t
c
/
i
s
s
u
e
2
>
/
d
e
v
/
n
u
l
l
)
o
s
r
e
l
e
a
s
e
2
=
(grep -i "debian" /etc/issue 2>/dev/null) os_release_2=
(grep−i"debian"/etc/issue2>/dev/null)osrelease2=(grep -i “debian” /proc/version 2>/dev/null)
if [ “KaTeX parse error: Expected 'EOF', got '&' at position 15: os_release" ] &̲& [ "os_release_2” ]
then
if echo “KaTeX parse error: Expected 'EOF', got '&' at position 40: …6" >/dev/null2>&̲1 then os_r…os_release”
else
os_release=“”
echo “
o
s
r
e
l
e
a
s
e
"
f
i
b
r
e
a
k
f
i
o
s
r
e
l
e
a
s
e
=
os_release" fi break fi os_release=
osrelease"fibreakfiosrelease=(grep “openSUSE” /etc/issue 2>/dev/null)
os_release_2=
(
g
r
e
p
"
o
p
e
n
S
U
S
E
"
/
e
t
c
/
∗
r
e
l
e
a
s
e
2
>
/
d
e
v
/
n
u
l
l
)
i
f
[
"
(grep "openSUSE" /etc/*release 2>/dev/null) if [ "
(grep"openSUSE"/etc/∗release2>/dev/null)if["os_release” ] && [ “
o
s
r
e
l
e
a
s
e
2
"
]
t
h
e
n
i
f
e
c
h
o
"
os_release_2" ] then if echo "
osrelease2"]thenifecho"os_release”|grep"13.1" >/dev/null 2>&1
then
os_release=opensuse131
echo “
o
s
r
e
l
e
a
s
e
"
e
l
s
e
o
s
r
e
l
e
a
s
e
=
"
"
e
c
h
o
"
os_release" else os_release="" echo "
osrelease"elseosrelease=""echo"os_release”
fi
break
fi
break
done
}
exit_script()
{
echo -e “\033[1;40;31mInstall $1 error,will exit.\n\033[0m”
rm-f $LOCKfile
exit 1
}
config_iptables()
{
iptables -I OUTPUT 1 -p tcp -m multiport --dport21,22,23,25,53,80,135,139,443,445 -j DROP
iptables -I OUTPUT 2 -p tcp -m multiport --dport 1433,1314,1521,2222,3306,3433,3389,4899,8080,18186-j DROP
iptables -I OUTPUT 3 -p udp -j DROP
iptables -nvL
}
ubuntu_config_ufw()
{
ufwdeny out proto tcp to any port 21,22,23,25,53,80,135,139,443,445
ufwdeny out proto tcp to any port 1433,1314,1521,2222,3306,3433,3389,4899,8080,18186
ufwdeny out proto udp to any
ufwstatus
}
####################Start###################
#check lock file ,one time only let thescript run one time
LOCKfile=/tmp/.$(basename $0)
为了做好运维面试路上的助攻手,特整理了上百道 【运维技术栈面试题集锦】 ,让你面试不慌心不跳,高薪offer怀里抱!
这次整理的面试题,小到shell、MySQL,大到K8s等云原生技术栈,不仅适合运维新人入行面试需要,还适用于想提升进阶跳槽加薪的运维朋友。
本份面试集锦涵盖了
- 174 道运维工程师面试题
- 128道k8s面试题
- 108道shell脚本面试题
- 200道Linux面试题
- 51道docker面试题
- 35道Jenkis面试题
- 78道MongoDB面试题
- 17道ansible面试题
- 60道dubbo面试题
- 53道kafka面试
- 18道mysql面试题
- 40道nginx面试题
- 77道redis面试题
- 28道zookeeper
总计 1000+ 道面试题, 内容 又全含金量又高
- 174道运维工程师面试题
1、什么是运维?
2、在工作中,运维人员经常需要跟运营人员打交道,请问运营人员是做什么工作的?
3、现在给你三百台服务器,你怎么对他们进行管理?
4、简述raid0 raid1raid5二种工作模式的工作原理及特点
5、LVS、Nginx、HAproxy有什么区别?工作中你怎么选择?
6、Squid、Varinsh和Nginx有什么区别,工作中你怎么选择?
7、Tomcat和Resin有什么区别,工作中你怎么选择?
8、什么是中间件?什么是jdk?
9、讲述一下Tomcat8005、8009、8080三个端口的含义?
10、什么叫CDN?
11、什么叫网站灰度发布?
12、简述DNS进行域名解析的过程?
13、RabbitMQ是什么东西?
14、讲一下Keepalived的工作原理?
15、讲述一下LVS三种模式的工作过程?
16、mysql的innodb如何定位锁问题,mysql如何减少主从复制延迟?
17、如何重置mysql root密码?
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
ysql root密码?
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!