首页
关于
Search
1
一个好用的OneDrive网盘上传工具,支持文件和文件夹上传
877 阅读
2
MySQL数据库查看锁表解锁命令
851 阅读
3
在Ubuntu Linux上使用端口敲门保护SSH服务器
718 阅读
4
多种功能强大的BT离线下载程序Docker镜像及安装
551 阅读
5
unlock-music:支持解密网易云/QQ音乐的加密文件和ID3信息补全
537 阅读
默认
文档
资源
授权
登录
Search
标签搜索
Linux
Ubuntu
Nginx
SSL
Centos
OpenSSL
Git
Windows
Let’s Encrypt
acme.sh
Microsoft
KMS
qcloud
腾讯云
Docker
GOLANG
BBR
MySQL
HiYae.
累计撰写
42
篇文章
累计收到
0
条评论
首页
栏目
默认
文档
资源
授权
页面
关于
搜索到
6
篇与
Ubuntu
的结果
2022-04-21
Ubuntu18.04 配置静态IP地址
vim /etc/netplan/01-network-manager-all.yaml静态IP:# Let NetworkManager manage all devices on this system #network: # version: 2 # renderer: NetworkManager # ethernets: # enp6s0: # dhcp4: yes network: version: 2 ethernets: enp6s0: dhcp4: no addresses: [192.168.1.22/24] optional: true gateway4: 192.168.1.1 nameservers: addresses: [192.168.1.1]DHCP:# Let NetworkManager manage all devices on this system network: version: 2 renderer: NetworkManager ethernets: enp6s0: dhcp4: yes #network: # version: 2 # ethernets: # enp6s0: # dhcp4: no # addresses: [192.168.1.22/24] # optional: true # gateway4: 192.168.1.1 # nameservers: # addresses: [192.168.1.1]sudo netplan apply
2022年04月21日
46 阅读
0 评论
0 点赞
2022-04-20
Ubuntu 18.04源
1、阿里云源##阿里源 deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse2、中科大源##中科大源 deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse3、163源##163源 deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse4、清华源##清华源 deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse替换源cp /etc/apt/sources.list /etc/apt/sources.list.bak vim /etc/apt/sources.list sudo apt-get update
2022年04月20日
16 阅读
0 评论
0 点赞
2022-04-06
Ubuntu 18.04 配置防火墙iptables(常见iptables的用法记录)
基于服务器的安全考虑,需要在Ubuntu 18.04环境中进行配置iptables防火墙,这里简单的记录iptables的常规用法。一般都是在需要服务器的ROOT权限下进行的,有些服务器环境默认是安装过的,需要检查到底是否有安装,如果有安装过,直接就添加防火墙规则。第一、检查是否安装iptables# 检查 # which iptables /sbin/iptables # whereis iptables iptables: /sbin/iptables /etc/iptables /usr/share/iptables /usr/share/man/man8/iptables.8.gz第二、安装iptables如果没有安装的话,则需要安装。# 进行安装 sudo apt-get install iptables第三、如果安装过创建规则vi /etc/iptables添加规则。*filter :INPUT DROP [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] :syn-flood - [0:0] -A INPUT -i lo -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 7070 -j ACCEPT -A INPUT -p icmp -m limit --limit 100/sec --limit-burst 100 -j ACCEPT -A INPUT -p icmp -m limit --limit 1/s --limit-burst 10 -j ACCEPT -A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j syn-flood -A INPUT -j REJECT --reject-with icmp-host-prohibited -A syn-flood -p tcp -m limit --limit 3/sec --limit-burst 6 -j RETURN -A syn-flood -j REJECT --reject-with icmp-port-unreachable COMMIT然后保存规则iptables-save > /etc/iptables第四、创建规则确保重启也执行iptable规则vi /etc/network/if-pre-up.d/iptables添加:iptables-restore < /etc/iptables保存退出。第五、查看防火墙规则iptables -L这里可以看到所有的防火墙设置。Chain INPUT (policy DROP) target prot opt source destination ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:https ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:mysql ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http-alt ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:7070 ACCEPT icmp -- anywhere anywhere limit: avg 100/sec burst 100 ACCEPT icmp -- anywhere anywhere limit: avg 1/sec burst 10 syn-flood tcp -- anywhere anywhere tcp flags:FIN,SYN,RST,ACK/SYN REJECT all -- anywhere anywhere reject-with icmp-host-prohibited Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination Chain syn-flood (1 references) target prot opt source destination RETURN tcp -- anywhere anywhere limit: avg 3/sec burst 6 REJECT all -- anywhere anywhere reject-with icmp-port-unreachable
2022年04月06日
42 阅读
0 评论
0 点赞
2022-04-01
在Ubuntu Linux上使用端口敲门保护SSH服务器
概要端口敲门是一种用于保护端口免受未经授权用户访问的方法。通过在一组预先指定的关闭端口上生成连接尝试,打开端口的方法是打开防火墙上的端口。一旦收到正确的连接尝试序列,防火墙将打开以前关闭的端口。端口爆震的主要目的是防御端口扫描程序。更改默认的ssh端口不是保护服务器的安全方法,因为攻击者经常在攻击服务器之前使用端口扫描程序对打开的端口进行自动扫描。因此,敲除端口是保护SSH服务器的最佳方法。例如,如果要设置端口22的端口断开功能,则仅当您依次请求端口10001、10002、10003时,此端口才会打开。正确完成序列后,防火墙将为您打开端口22。系统要求运行安装了ssh的Ubuntu 16.04的服务器。在您的服务器上设置了root密码。入门开始之前,建议使用以下命令将存储库更新为最新版本: apt-get update -y更新存储库后,请重新启动系统以应用所有更改。安装和配置iptables默认情况下,UFW防火墙安装在Ubuntu 16.04服务器中。因此,在安装iptables之前,你需要禁用UFW。可以使用以下命令禁用UFW: ufw disable接下来,通过运行以下命令来安装iptables: apt-get install iptables iptables-persistent一旦安装了iptables,你将需要允许所有已建立的连接和正在进行的会话通过iptables。可以使用以下命令执行此操作: iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT接下来,使用以下命令阻止传入的SSH端口22: iptables -A INPUT -p tcp --dport 22 -j REJECT接下来,使用以下命令保存防火墙规则: netfilter-persistent save netfilter-persistent reload接下来,你可以通过从远程系统发出命令来测试SSH端口是否被阻止安装和配置Knockd默认情况下,Ubuntu 16.04默认存储库中可使用 knocked。你可以通过运行以下命令来安装它: apt-get install knockd -y一旦安装了端口敲门服务后,你将需要启用敲门服务才能使用。可以通过编辑 /etc/default/knockd 文件来做到这一点: vim /etc/default/knockd更改行从 START_KNOCKD=0变更为 START_KNOCKD=1完成后保存并关闭文件。接下来,你可以通过编辑 /etc/knockd.conf 文件来配置敲门: vim /etc/knockd.conf根据你的需求更改 [openSSH] 和 [closeSSH] 部分的默认敲门端口:示例1:通过指定序列 打开 或 关闭 SSH的22端口 [options] logfile = /var/log/knockd.log [openSSH] sequence = 10001,10002,10003 seq_timeout = 20 tcpflags = syn command = /sbin/iptables -I INPUT -s %IP% -p tcp --dport 22 -j ACCEPT [closeSSH] sequence = 10003,10002,10001 seq_timeout = 20 command = /sbin/iptables -D INPUT -s %IP% -p tcp --dport 22 -j ACCEPT tcpflags = syn示例2:通过指定序列 打开 SSH的22端口,并在指定时间后 关闭 SSH的22端口,同时不影响现有SSH会话 [options] logfile = /var/log/knockd.log [opencloseSSH] sequence = 2222:udp,3333:tcp,4444:udp seq_timeout = 15 tcpflags = syn,ack start_command = /usr/sbin/iptables -A INPUT -s %IP% -p tcp --dport 22 --syn -j ACCEPT cmd_timeout = 5 stop_command = /usr/sbin/iptables -D INPUT -s %IP% -p tcp --dport 22 --syn -j ACCEPT完成后保存文件,然后启动敲门服务以应用以下更改: systemctl start knockd设置开机启动敲门服务 systemctl enable knockd注意: * sequence = 10001,10002,10003 :当从客户端计算机完成序列时,Knock将**打开SSH端口**。 * seq_timeout = 20 :此选项定义您有**多长时间**来完成敲门音序。 * command = /sbin/iptables -I INPUT -s %IP% -p tcp –dport 22 -j ACCEPT :此命令将**打开端口22**。 * sequence = 10003,10002,10001 :当从客户端计算机完成序列时,Knock将**关闭SSH端口**。 * command = /sbin/iptables -D INPUT -s %IP% -p tcp –dport 22 -j ACCEPT :此命令将**关闭端口22**。从客户端系统测试敲门现在该测试客户端系统的敲门事件了。您可以使用Telnet,Nmap或Knockd客户端测试敲门。在这里,我将使用Telnet客户端测试敲门。因此,你需要将Telnet安装到客户端系统。运行以下命令以安装Telnet: apt-get install telnet -y接下来,在20秒内以正确的顺序运行以下命令: telnet X.X.X.X 10001 telnet X.X.X.X 10002 telnet X.X.X.X 10003一旦所有命令都成功。Knockd将通过为客户端系统添加防火墙规则来打开SSH端口。你还可以通过在服务器上运行以下命令来查看已删除的日志。 tail -f /var/log/knockd.log输出: [2020-12-23 09:11] X.X.X.X: openSSH: Stage 1 [2020-12-23 09:12] X.X.X.X: openSSH: Stage 2 [2020-12-23 09:13] X.X.X.X: openSSH: Stage 3 [2020-12-23 09:13] X.X.X.X: openSSH: OPEN SESAME [2020-12-23 09:13] openSSH: running command: /sbin/iptables -I INPUT -s X.X.X.X -p tcp --dport 22 -j ACCEPT现在,您可以从客户端系统通过SSH连接服务器。完成所有工作后,要关闭IP的SSH端口。在20秒内以正确的顺序运行以下命令: telnet X.X.X.X 10003 telnet X.X.X.X 10002 telnet X.X.X.X 10001一旦所有命令都成功。Knockd将通过为客户端系统添加防火墙规则来关闭SSH端口。结论恭喜你!你已成功测试过Ubuntu 16.04的端口敲门功能。现在,您可以轻松地通过SSH从任何位置或任何系统访问服务器。
2022年04月01日
718 阅读
0 评论
2 点赞
2022-03-31
Ubuntu 安装 Docker
1.卸载旧版本 sudo apt-get remove docker docker-engine docker.io containerd runc2.通过存储库安装2.1 更新apt软件包索引并安装软件包以允许apt通过HTTPS使用存储库 sudo apt-get update2.2 添加Docker的官方GPG密钥 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -2.3 通过搜索指纹的后8个字符,验证您现在是否拥有带有指纹的密钥 sudo apt-key fingerprint 0EBFCD882.4 添加安装源 sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"3.安装DOCKER引擎 sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io4.添加普通用户权限 sudo usermod -aG docker <your-user>5. 安装Docker Compose sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose6. 验证安装 docker-compose --version
2022年03月31日
70 阅读
0 评论
0 点赞
1
2