ssh key
mkdir .ssh && cd .ssh
echo "id_pub" > authorized_keys
chmod 600 authorized_keys
chmod 700 .
sed -i 's/PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config
cat >> /etc/ssh/sshd_config << 'EOF'
RSAAuthentication yes
PubkeyAuthentication yes
EOF
systemctl reload sshd
script
mkdir script
cd script
BBR
wget -P ~/script/ https://raw.githubusercontent.com/Akasakar/The_Girl_Friend_Wallpaper/master/bbr_install.sh
curl -C - -o ~/script/bbr_install.sh https://raw.githubusercontent.com/Akasakar/The_Girl_Friend_Wallpaper/master/bbr_install.sh
# update kernel for CenOS8 commit
bash ~/script/bbr_install.sh &
yum
yum -y update
yum -y install epel-release
yum -y install vim git zsh unzip make zlib zlib-devel gcc-c++ \
libtool openssl openssl-devel socat net-tools
vim
yum -y install vim
cat >> ~/.vimrc << 'EOF'
filetype plugin indent on
set nu et acd
set ls=2 ts=4 sts=4 sw=4
EOF
- install
yum -y install zsh curl wget git
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
- configure
sed -i 's/robbyrussell/agnoster/' ~/.zshrc
cat >> ~/.zshrc<<EOF
prompt_context() {
if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
prompt_segment black default "%(!.%{%F{yellow}%}.)$USER"
fi
}
EOF
cat >> ~/.zshrc<<EOF
alias ll='ls -alF'
EOF
source ~/.zshrc
下面荡的Project V
新 V2Ray 白话文指南:安装v2ray
v2ray
wget -P ~/script/ https://install.direct/go.sh
bash ~/script/go.sh
systemctl start v2ray
# check config
sudo /usr/bin/v2ray/v2ray -test -config /etc/v2ray/config.json
wget -P ~/script/ https://raw.githubusercontent.com/trojan-gfw/trojan-quickstart/master/trojan-quickstart.sh
bash ~/script/trojan-quickstart.sh
ln -s /usr/local/etc/trojan /etc/trojan
新 V2Ray 白话文指南:TLS
SSL证书
curl https://get.acme.sh | sh
#证书生成
#执行以下命令生成证书:
#以下的命令会临时监听 80 端口,请确保执行该命令前 80 端口没有使用
sudo ~/.acme.sh/acme.sh --issue --standalone -k ec-256 -d mydomain.me
#证书更新
sudo ~/.acme.sh/acme.sh --renew -d mydomain.com --force --ecc
#安装证书和密钥
sudo ~/.acme.sh/acme.sh --installcert -d mydomain.me --fullchainpath /etc/v2ray/v2ray.crt --keypath /etc/v2ray/v2ray.key --ecc
wget -P ~/script/ https://raw.githubusercontent.com/Akasakar/The_Girl_Friend_Wallpaper/master/domain_acme.sh
Apache
yum -y install httpd mod_ssl openssl
# config file path
/etc/httpd/conf.d/
Haproxy
/etc/haproxy/haproxy.cfg
fail2ban
cat >> /etc/fail2ban/jail.local << 'EOF'
[DEFAULT]
ignoreip = 127.0.0.1/8
bantime = 86400
findtime = 600
maxretry = 3
[sshd]
enabled = true
EOF
firewall-cmd
firewall-cmd --add-services=http
- prequirement
If you are using CentOS 7, you need to install these prequirement to build from source code:
yum -y install epel-release
yum -y install gcc gettext autoconf libtool automake make pcre-devel asciidoc xmlto c-ares-devel libev-devel libsodium-devel mbedtls-devel
- build shadowsocks-libev
git clone https://github.com/shadowsocks/shadowsocks-libev.git
cd shadowsocks-libev
git submodule update --init
./autogen.sh && ./configure && make
make install
sample obfs
- prequirement
# Debian / Ubuntu
sudo apt-get install --no-install-recommends build-essential autoconf libtool libssl-dev libpcre3-dev libev-dev asciidoc xmlto automake
# CentOS / Fedora / RHEL
sudo yum install gcc autoconf libtool automake make zlib-devel openssl-devel asciidoc xmlto libev-devel
- build sample-obfs
git clone https://github.com/shadowsocks/simple-obfs.git
cd simple-obfs
git submodule update --init --recursive
./autogen.sh
./configure && make
sudo make install
- creat directory
mkdir -p /etc/shadowsocks-libev/
- /etc/shadowsocks-libev/config.json
{
"server": "0.0.0.0",
"server_port": 443,
"local_port": 1080,
"password": "psw",
"timeout": 60,
"method": "aes-256-gcm",
"plugin": "obfs-server",
"plugin_opts": "obfs=http"
}
- /etc/systemd/system/shadowsocks.service
[Unit]
Description=Shadowsocks Server
After=network.target
[Service]
ExecStart=/usr/local/bin/ss-server -c /etc/shadowsocks-libev/config.json -u
Restart=on-abort
[Install]
WantedBy=multi-user.target
systemctl enable shadowsocks
systemctl start shadowsocks
systemctl status shadowsocks