美文网首页网络
在 Vultr 上安装 Shadowsocks 和开启 SSH

在 Vultr 上安装 Shadowsocks 和开启 SSH

作者: 北冢 | 来源:发表于2018-04-17 14:44 被阅读717次

1. 购买 Vultr VPS

这个东西教程比较多,就不赘述了。

2. 登录 Vultr 服务器

使用 Vultr 后台提供的 root 密码进行登录。进入如下界面:

已经成功登录到服务器

3. 使用一键安装脚本安装 SSR

wget -N --no-check-certificate https://softs.fun/Bash/ssr.sh && chmod +x ssr.sh && bash ssr.sh

然后根据提示进行选择就行。

4. 开启 SSH 登录

$ ssh-keygen -t rsa <== 建立密钥对
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): <== 按 Enter
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase): <== 输入密钥锁码,或直接按 Enter 留空
Enter same passphrase again: <== 再输入一遍密钥锁码
Your identification has been saved in /root/.ssh/id_rsa. <== 私钥
Your public key has been saved in /root/.ssh/id_rsa.pub. <== 公钥
  1. id_rsa.pub 改名为 authorized_keys,并放置到 /root/.ssh/ 下。
  2. 编辑 sshd_config 配置文件 vim /etc/ssh/sshd_config

sshd_config 配置文件修改相关选项如下:

RSAAuthentication yes #RSA认证
PubkeyAuthentication yes #开启公钥验证
AuthorizedKeysFile .ssh/authorized_keys #验证文件路径
PasswordAuthentication no #禁止密码认证
PermitEmptyPasswords no #禁止空密码
  1. 重启 SSH 服务, CentOS 7 使用命令 systemctl restart sshd。
  2. id_rsa 中的私钥复制下来保存在自己的 Mac 上的 ~/.ssh/id_rsa_ssr
  3. ~/.ssh/ 目录下新建文件 config,内容如下:
Host VPS
Hostname xxx.xxx.xxx.xxx
Port 22
User root
IdentityFile ~/.ssh/id_rsa_ssr
  1. iTermTerminal 中使用 ssh VPS 来登录 VPS。

  2. 开始和使用 BBR

https://github.com/xratzh/CBBR

相关文章

网友评论

    本文标题:在 Vultr 上安装 Shadowsocks 和开启 SSH

    本文链接:https://www.haomeiwen.com/subject/kiaukftx.html