Linux

Install Docker on Debian

Step1: Install some necessary packages. apt update apt upgrade -y apt install curl vim wget gnupg dpkg apt-transport-https lsb-release ca-certificates Step2: Set up Docker’s apt repository. curl -sSL https://download.docker.com/linux/debian/gpg | gpg –dearmor > /usr/share/keyrings/docker-ce.gpg echo “deb [arch=$(dpkg –print-architecture) signed-by=/usr/share/keyrings/docker-ce.gpg] https://download.docker.com/linux/debian…

Change SSH Port

wget –no-check-certificate <a href="https://www.moerats.com/usr/down/sshport.sh">https://www.moerats.com/usr/down/sshport.sh</a&gt; 系统要求:支持Debian、Ubuntu、CentOS系统。 运行以下命令: wget <a href="https://www.moerats.com/usr/down/sshport.sh">https://www.moerats.com/usr/down/sshport.sh</a&gt; bash sshport.sh 输入端口确认。再打开防火墙端口: 最后重启ssh生效: service ssh restart

服务器配置密钥登录并禁止密码登录一键脚本

如果你有很多服务器,那么配置公钥是一件很枯燥的事情,于是,一键配置脚本应运而生。 ❗ 请注意,PUB_KEY 可以手动填写或者从你的 github 中下载,亦或者是从某个网站下载。 ❗ 请注意,务必先思考是要 增加 还是 覆盖 公钥,然后择一运行,否则你的公钥可能丢失。 下方代码可以直接粘贴在 Linux Bash 中运行,但是,请将公钥链接替换为自己的 Github 地址或者其他【可访问】的 URL!! #!/usr/bin/env bash PUB_KEY=$(curl -fsSL https://github.com/someone.keys) if [ ! -f “${HOME}/.ssh/authorized_keys” ]; then mkdir -p ${HOME}/.ssh/ touch ${HOME}/.ssh/authorized_keys fi 1. 追加 echo…

云服务器修改默认 root 登录

一些云厂商,例如 AWS 和 Azure,默认禁止 Root 登录,需要 admin 登陆后,再执行 sudo su root 来提权,以保障安全。 运行如下脚本即可一键解决此类问题。   sudo su root cd sudo sed -i 's/^.PermitRootLogin./PermitRootLogin yes/g' /etc/ssh/sshd_config; sudo sed -i 's/^.PasswordAuthentication./PasswordAuthentication yes/g' /etc/ssh/sshd_config; sudo service sshd restart sed -i 's/.(ssh-ed25519 .)/\1/' ~/.ssh/authorized_keys 1. 你也有可能用的是ssh-rsa,那么就把上面的ssh-ed25519改成ssh-rsa 1.…

Linux上使用Duplicati进行备份

Duplicati安装 从https://www.duplicati.com/download下载最新版本 该软件需要几个库才能工作,主要是单声道库。 安装软件最简单的方法是让它通过dpkg安装失败,然后使用apt-get安装缺少的软件包: sudo dpkg -i duplicati_2.0.6.3-1_all.deb sudo apt-get –fix-broken install 请注意,安装程序包在第一个实例上失败,然后我们使用apt来安装依赖项。 启动守护进程: sudo systemctl start duplicati.service 如果您希望在操作系统使用时自动启动: sudo systemctl enable duplicati.service 要检查服务正在运行: netstat -ltn | grep 8200

Docker 搭建thelounge 实现IRC24小时在线

下载docker镜像 docker pull linuxserver/thelounge 运行docker镜像 docker run -d –name=thelounge -e PUID=1000 -e PGID=1000 -e TZ=Asia/Shanghai -p 9000:9000 -v /opt/thelounge:/config –restart unless-stopped linuxserver/thelounge 设置仅允许指定用户 vim /opt/thelounge/config.js 修改其中的public为false,然后使用docker restart thelounge,重启容器 添加自己的用户 docker exec -it thelounge s6-setuidgid abc thelounge add user user可以用你喜欢的用户名替代,执行这一条以后就会提示你输入密码。

Debian 搭建 FTP 服务器

安装配置 FTP 服务器 安装 vsftpd sudo apt update sudo apt install vsftpd 配置 vsftpd sudo vim /etc/vsftpd.conf 修改文件中以下内容内容: 服务器监听,开启ipv6 listen=NO listen_ipv6=YES 禁止匿名访问, 否则脚本可** anonymous_enable=NO 允许本地主机访问 local_enable=YES 允许写权限 write_enable=YES dirmessage_enable=YES 增加访问账号 增加 ftpgroup 用户组 sudo groupadd ftpgroup 创建目录,可自定: sudo mkdir -p…