当前位置:网站首页>V自P建N_部署使用
V自P建N_部署使用
2022-07-23 12:01:00 【我十贰点就睡】
使用ss搭建vpn
首先需要自行购买服务器,同时需要公网地址
假设我们已经有了一台服务器了
1 安装必要软件
安装python的pip工具
yum install python-setuptools -y
wget https://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz --no-check-certificate
tar -xzvf pip-1.3.1.tar.gz
cd pip-1.3.1
python setup.py install
pip install shadowsocks
2 配置文件
创建配置文件
mkdir /etc/shadowsocks
vi /etc/shadowsocks/config.json
{
"server":"0.0.0.0",
"server_port":1024,
"password":"your_password",
"timeout":600,
"method":"aes-256-cfb",
"fast_open": false
}
注释:
“server”:是你Vultr服务器的ip地址
"server_port"和"password"可以根据自己的要求设定
如果需要同时开多个端口,config.json的内容可以设置如下:
{
"server":"0.0.0.0",
"port_password": {
"8388": "your_password1",
"8389": "your_password2"
},
"timeout":600,
"method":"aes-256-cfb",
"fast_open": false
}
3 启停命令以及开机自启动(很有必要)
ssserver -c /etc/shadowsocks.json -d start
ssserver -c /etc/shadowsocks.json -d stopvi /etc/systemd/system/shadowsocks.service
[Unit]
Description=Shadowsocks
After=network.target
[Service]
Type=forking
PIDFile=/run/shadowsocks/server.pid
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /run/shadowsocks
ExecStartPre=/bin/chown root:root /run/shadowsocks
ExecStart=/usr/bin/ssserver --pid-file /var/run/shadowsocks/server.pid -c /etc/shadowsocks/config.json -d start
Restart=on-abort
User=root
Group=root
UMask=0027
[Install]
WantedBy=multi-user.target
给予权限
chmod 755 /etc/systemd/system/shadowsocks.service
systemctl start shadowsocks
systemctl enable shadowsocks
4 安全组放开对应端口即可
5 定时任务
# 定时关机
1 19 * * * bash /root/aliyun-cli.sh
55 23 * * * bash /root/aliyun-cli.sh
# 系统重启时启动服务
@reboot sleep 15 && /etc/init.d/ssr restart
边栏推荐
- How beautiful can VIM be configured?
- CS5363,CS5350,CS5328几款太阳能板电池充电管理IC的功能特性与参数对比
- ten thousand and one hundred
- Go language learning - Review package, interface, file operation
- 1060 Are They Equal
- 在多个数字(有重复)中找到最小值以及所在位置
- harbor镜像仓库
- vulnstack红日-4
- sqlnet. Ora-12154 and ora-01017 connection exceptions caused by incorrect ora file settings
- 超详细MP4格式分析
猜你喜欢

MySQL - master-slave replication

Expression du suffixe (une question par jour pendant les vacances d'été 4)

“1+1>10”:无代码/低代码与RPA技术的潜在结合

MySQL 灵魂 16 问,你能撑到第几问?

Bubble sort - just read one

服务器性能调优经验总结

冒泡排序-看着一篇就够啦

js过滤/替换敏感字符

满足多种按键的高性价比、高抗干扰触摸IC:VK3606D、VK3610I、VK3618I 具有高电源电压抑制比
![[paper study] source mixing and separation robot audio steganography](/img/e1/55e8f6a3e754d728fe6b685a08fdbc.png)
[paper study] source mixing and separation robot audio steganography
随机推荐
Find the minimum value and location in multiple numbers (with repetition)
Redis sentinel mode
Vinka推出高抗干扰VK36N系列触摸IC:VK36N1D,VK36N2P,VK36N3B,VK36N4I 使用便利
Redis installation
Kubernetes 基本概念和部署
SharedPreferences数据储存
High cost performance, high anti-interference touch IC that meets a variety of keys: vk3606d, vk3610i, vk3618i have high power voltage rejection ratio
C语言学习笔记
Mailbox communication-
Redis master-slave replication
Unity-笔记-ILRuntime接入
SOC的第一个Hello_World实验
ECS remote monitoring
中年危机,35岁被退休,打工人拿什么来抗衡资本家?
Cover - computer knowledge guide
C language learning notes
【深入浅出向】从自信息到熵、从相对熵到交叉熵,nn.CrossEntropyLoss, 交叉熵损失函数与softmax,多标签分类
Harbor image warehouse
harbor镜像仓库
【云原生】持续集成和部署(Jenkins)