如有侵权,请联系我E-mail删除。谢谢!


记录下自己的VPS常用操作

配置SSH使用密钥KEY登陆

mkdir .ssh
chmod 700 .ssh
touch .ssh/authorized_keys
chmod 600 .ssh/authorized_keys

写入公钥内容,(替换成自己的公钥)

echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAw8G3KL6oxDQ92IkrAjKbmyXN4qiYSbVQ4iFF94mTN2muiAaYGBlP/fL5d/os5Qxs9lmEOPgJsLUbSmsVfpO6RCqzVXILNWT3FduEJ2T59YYv/nNdu2OJEHU6eZQjQrUMqmb6LRtKgORoNELqwCYgHasughlZb8cKcd9u1Icbd3CLaiZg9ebGvQf3+o/shoaRt75BgtWtrVXwy5iX1W6070Tw+GTpDKFPwdgg/IffvZ9MORGmHSWHHzELjQ7nnS9CgzWUsoC4qQrgNo6RkA75yps5OZ9GrtDVmuhuRdmTyDv7Yvp2UII78RpsW686HWK2cD5PV+JlJOkNbJklxI8AwQ==" > .ssh/authorized_keys

修改SSH配置文件/etc/ssh/sshd_config启用KEY登陆

sed -i 's/#PubkeyAuthentication/PubkeyAuthentication/' /etc/ssh/sshd_config

重启SSH

service sshd restart
/etc/init.d/ssh restart

退出SSH登陆,使用KEY如果能顺利登陆的话就禁用密码登陆

sed -i 's/PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config

更改SSH端口号(慎重,请确保正确配置好了防火墙)

sed -i 's/#Port 22/Port 6789/' /etc/ssh/sshd_config

DD系统

安装依赖软件

Debian/Ubuntu:

apt-get install -y xz-utils openssl gawk file

RedHat/CentOS:

yum install -y xz openssl gawk file

DD系统Debian 10

bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 10 -v 64 -p "自定义root密码" -port "自定义ssh端口"

甲骨文Debian 10配置ipv6地址

echo "iface ens3 inet6 dhcp" >> /etc/network/interfaces
reboot

oracle 一键dd win7精简版

wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://dl-web.dropbox.com/s/zx55mqjgcoudqmq/Uefi-gpt-Win7-Ent-Administrator-www.nat.ee_Oracle.gz'

账号:Administrator 密码:www.nat.ee

开启TCP BBR

配置文件

echo "net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf

加载配置到内核参数中

sysctl -p
sysctl net.ipv4.tcp_available_congestion_control

通过lsmod | grep bbr测试

bitwarden密码管理器

docker run -d --name bitwarden --restart=always -e TZ=Asia/Shanghai -e SHOW_PASSWORD_HINT=false -v /bw-data/:/data/ -p 45729:80 -e SIGNUPS_ALLOWED=false -e INVITATIONS_ALLOWED=false -e ADMIN_TOKEN='$argon2id$v=19$m=65540,t=3,p=4$iK/BPqYwoMPsukcDLJH+oUV1OSGkI0NRSgpGJam3Y6A$PTk/xhEI0bWQk8mWwk8HWdOQMwOipBAtMSEU8CAt274' vaultwarden/server:latest