id: 0078c9f065774404a2fe48f47a13de50
parent_id: 
item_type: 1
item_id: de25178b06534e95a0e0beab3a7edd09
item_updated_time: 1764345479925
title_diff: "[{\"diffs\":[[1,\"使用亚马逊AWS搭建免费的Shadowsocks服务器\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":27}]"
body_diff: "[{\"diffs\":[[1,\"<html>\\\r\\\n<head>\\\r\\\n  <title>使用亚马逊AWS搭建免费的Shadowsocks服务器</title>\\\r\\\n  <basefont face=\\\"微软雅黑\\\" size=\\\"2\\\" />\\\r\\\n  <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html;charset=utf-8\\\" />\\\r\\\n  <meta name=\\\"exporter-version\\\" content=\\\"YXBJ Windows/608924 (zh-CN, DDL); Windows/10.0.0 (Win64); EDAMVersion=V2;\\\"/>\\\r\\\n  <style>\\\r\\\n\\tbody, td {\\\r\\\n\\t  font-family: 微软雅黑;\\\r\\\n\\t  font-size: 12pt;\\\r\\\n\\t}\\\r\\\n  </style>\\\r\\\n</head>\\\r\\\n<body>\\\r\\\n<a name=\\\"15517\\\"></a>\\\r\\\n<h1>使用亚马逊AWS搭建免费的Shadowsocks服务器</h1>\\\r\\\n\\\r\\\n<div>\\\n<span><div><div><br/></div><table bgcolor=\\\"#D4DDE5\\\" border=\\\"0\\\"><colgroup><col></col></colgroup><tbody><tr><td colspan=\\\"1\\\" rowspan=\\\"1\\\"><h1>亚马逊AWS搭建Shadowsocks服务器</h1><div><span style=\\\"font-weight: bold;\\\">作者：</span> 黄康礼</div></td></tr></tbody></table><div><br clear=\\\"none\\\"/></div><div style=\\\"orphans: 2; widows: 2;\\\"><span style=\\\"white-space: nowrap;\\\"><a href=\\\"mailto:kl.huang@qq.com\\\" shape=\\\"rect\\\" style=\\\"font-family: arial;\\\">kl.huang@qq.com</a></span></div><div style=\\\"orphans: 2; widows: 2;\\\"><span style=\\\"font-family: arial;\\\">@mtjjtmp1</span></div><div style=\\\"orphans: 2; widows: 2;\\\"><div><br clear=\\\"none\\\"/></div></div><div><span style=\\\"font-size: 13px; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: nowrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(234, 243, 254); color: rgb(0, 0, 0); font-family: arial;\\\">弹性IP：<span style=\\\"background-color: rgb(234, 243, 254); color: rgb(0, 0, 0); font-family: arial; font-size: 13px;\\\">52.193.61.72</span></span></div><div><br clear=\\\"none\\\"/></div><div>{</div><div>&quot;server&quot;:&quot;0.0.0.0&quot;,</div><div>&quot;server_port&quot;:4443,</div><div>&quot;local_address&quot;:&quot;127.0.0.1&quot;,</div><div>&quot;local_port&quot;:1080,</div><div>&quot;password&quot;:&quot;jjtmp1&quot;,</div><div>&quot;timeout&quot;:300,</div><div>&quot;method&quot;:&quot;rc4-md5&quot;,</div><div>&quot;fast_open&quot;:false,</div><div>&quot;workers&quot;: 1</div><div>}</div><div><br clear=\\\"none\\\"/></div><hr/><div><br clear=\\\"none\\\"/></div></div><div><div><h1>连接到服务器</h1></div><div>定制完成后等几分钟，一般是在给你的服务器进行开发，等初始化完成后，就可以进行远程连接了，右键你的实例，点击连接。会弹出连接提示，如果你使用的是Windows，可以查看<a href=\\\"https://docs.aws.amazon.com/zh_cn/AWSEC2/latest/UserGuide/putty.html?console_help=true\\\" shape=\\\"rect\\\" target=\\\"_blank\\\">使用 PuTTY 从 Windows 连接到 Linux 实例</a>，如果你是Linux或者Mac OS，可以直接通过SSH连接到你的服务器，具体可以查看亚马逊给出的文档<a href=\\\"https://docs.aws.amazon.com/zh_cn/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html\\\" shape=\\\"rect\\\" target=\\\"_blank\\\">使用 SSH 连接到 Linux 实例</a>。</div><div><span style=\\\"font-weight: bold;\\\">记住下图中所示位置这个公有IP，它是你的Shadowssocks的服务器IP。</span></div><div><img src=\\\":/8020814c35ca4dc0a12c311b72d28c59\\\" type=\\\"image/png\\\" data-filename=\\\"2016011507.png\\\" alt=\\\"07\\\" width=\\\"576\\\"/></div><div><img src=\\\":/67ec7405b2944af8b384bbf5c693a09e\\\" type=\\\"image/png\\\" data-filename=\\\"2016011508.png\\\" alt=\\\"08\\\" width=\\\"576\\\"/></div><div>主要说说使用Mac OS系统通过SSH连接到服务器</div><div>首先，打开终端，使用<span style=\\\"font-weight: bold;\\\">chmod</span>命令确保私有密钥不是公开可见的：</div><div>chmod 400 /Users/Celery/.ssh/celerysoft.pem</div><div><span style=\\\"font-weight: bold;\\\">/Users/Celery/.ssh/celerysoft.pem</span> 是刚才下载的密钥对.pem文件的路径。</div><div>然后，通过<span style=\\\"font-weight: bold;\\\">ssh</span>命令连接到服务器</div><div>ssh -i /Users/Celery/.ssh/celerysoft.pem ec2-user@ec2-11-111-11-111.ap-northeast-1.compute.amazonaws.com</div><div><span style=\\\"font-weight: bold;\\\">ec2-user</span> 是用户名，Amazon Linux AMI默认的是ec2-user，</div><div><span style=\\\"font-weight: bold;\\\">ec2-11-111-11-111.ap-northeast-1.compute.amazonaws.com</span> 是你的服务器的公有DNS，这些信息右键点击你的实例，点击连接，弹出的提示框里都写着。</div><div>登录成功后，你能看到如下响应信息：</div><div>The authenticity of host 'ec2-198-51-100-1.compute-1.amazonaws.com (10.254.142.33)'</div><div>can't be established.</div><div>RSA key fingerprint is 1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f.</div><div>Are you sure you want to continue connecting (yes/no)?</div><div>输入yes，然后按回车。</div><div>遇到任何问题，都可以查阅亚马逊的<a href=\\\"https://docs.aws.amazon.com/zh_cn/AWSEC2/latest/UserGuide/AccessingInstances.html?console_help=true\\\" shape=\\\"rect\\\" target=\\\"_blank\\\">帮助文档</a>。</div><h1>三、在服务器安装及配置Shadowsocks</h1><div>任何关于配置和安装Shadowsocks的说明，可以查阅<a href=\\\"https://github.com/shadowsocks/shadowsocks/wiki\\\" shape=\\\"rect\\\" target=\\\"_blank\\\">Shadowsocks的项目Wiki</a>。</div><h2>安装Shadowsocks</h2><div>以此输入以下命令来安装Shadowsocks</div><div>sudo yum install -y python-setuptools</div><div>sudo easy_install pip</div><div>sudo pip install shadowsocks</div><div>仔细看看有没有错误，如无错误即可继续</div><h2>配置Shadowsocks</h2><div><span style=\\\"color: rgb(255, 0, 0);\\\">在终端输入</span></div><div><span style=\\\"color: rgb(255, 0, 0);\\\">ssserver -h</span></div><div><span style=\\\"color: rgb(255, 0, 0);\\\">查看</span><span style=\\\"color: rgb(255, 0, 0); font-weight: bold;\\\">Shadowsocks</span><span style=\\\"color: rgb(255, 0, 0);\\\">的帮助，适合进阶玩家。</span></div><div><span style=\\\"color: rgb(255, 0, 0);\\\">如果提示没有</span><span style=\\\"color: rgb(255, 0, 0); font-weight: bold;\\\">ssserver</span><span style=\\\"color: rgb(255, 0, 0);\\\">这个命令，可以通过</span></div><div><span style=\\\"color: rgb(255, 0, 0);\\\">which ssserver</span></div><div><span style=\\\"color: rgb(255, 0, 0);\\\">查看Shadowsocks的路径，一般是在/usr/local/bin目录下，我们只需要把/usr/local/bin加入到/etc/profile文件中即可。</span></div><div><span style=\\\"color: rgb(255, 0, 0);\\\">接下来创建shadowsocks目录，用于存放配置文件</span></div><div><span style=\\\"color: rgb(255, 0, 0);\\\">mkdir /etc/shadowsocks</span></div><div><span style=\\\"color: rgb(255, 0, 0);\\\">创建其配置文件</span></div><div><span style=\\\"color: rgb(255, 0, 0);\\\">sudo vim /etc/shadowsocks/config.json</span></div><div>配置文件的内容如下</div><div>{</div><div>&quot;server&quot;:&quot;0.0.0.0&quot;,</div><div>&quot;server_port&quot;:443,</div><div>&quot;local_address&quot;:&quot;127.0.0.1&quot;,</div><div>&quot;local_port&quot;:1080,</div><div>&quot;password&quot;:&quot;celerysoft.github.io&quot;,</div><div>&quot;timeout&quot;:300,</div><div>&quot;method&quot;:&quot;aes-256-cfb&quot;,</div><div>&quot;fast_open&quot;:false,</div><div>&quot;workers&quot;: 1</div><div>}</div><table style=\\\"border-collapse: collapse; min-width: 100%;\\\"><colgroup><col style=\\\"width: 130px;\\\"></col><col style=\\\"width: 130px;\\\"></col></colgroup><tbody><tr><td rowspan=\\\"1\\\" style=\\\"border: 1px solid rgb(204, 204, 204); width: 130px; padding: 8px;\\\">配置文件说明</td><td rowspan=\\\"1\\\" style=\\\"border: 1px solid rgb(204, 204, 204); width: 130px; padding: 8px;\\\"><div><br clear=\\\"none\\\"/></div></td></tr><tr><td rowspan=\\\"1\\\" style=\\\"border: 1px solid rgb(204, 204, 204); width: 130px; padding: 8px;\\\">server</td><td rowspan=\\\"1\\\" style=\\\"border: 1px solid rgb(204, 204, 204); width: 130px; padding: 8px;\\\">服务端监听地址(IPv4或IPv6)</td></tr><tr><td rowspan=\\\"1\\\" style=\\\"border: 1px solid rgb(204, 204, 204); width: 130px; padding: 8px;\\\">server_port</td><td rowspan=\\\"1\\\" style=\\\"border: 1px solid rgb(204, 204, 204); width: 130px; padding: 8px;\\\">服务端端口，一般为443</td></tr><tr><td rowspan=\\\"1\\\" style=\\\"border: 1px solid rgb(204, 204, 204); width: 130px; padding: 8px;\\\">local_address</td><td rowspan=\\\"1\\\" style=\\\"border: 1px solid rgb(204, 204, 204); width: 130px; padding: 8px;\\\">本地监听地址，缺省为127.0.0.1</td></tr><tr><td rowspan=\\\"1\\\" style=\\\"border: 1px solid rgb(204, 204, 204); width: 130px; padding: 8px;\\\">local_port</td><td rowspan=\\\"1\\\" style=\\\"border: 1px solid rgb(204, 204, 204); width: 130px; padding: 8px;\\\">本地监听端口，一般为1080</td></tr><tr><td rowspan=\\\"1\\\" style=\\\"border: 1px solid rgb(204, 204, 204); width: 130px; padding: 8px;\\\">password</td><td rowspan=\\\"1\\\" style=\\\"border: 1px solid rgb(204, 204, 204); width: 130px; padding: 8px;\\\">用以加密的密匙</td></tr><tr><td rowspan=\\\"1\\\" style=\\\"border: 1px solid rgb(204, 204, 204); width: 130px; padding: 8px;\\\">timeout</td><td rowspan=\\\"1\\\" style=\\\"border: 1px solid rgb(204, 204, 204); width: 130px; padding: 8px;\\\">超时时间（秒）</td></tr><tr><td rowspan=\\\"1\\\" style=\\\"border: 1px solid rgb(204, 204, 204); width: 130px; padding: 8px;\\\">method</td><td rowspan=\\\"1\\\" style=\\\"border: 1px solid rgb(204, 204, 204); width: 130px; padding: 8px;\\\">加密方法，默认为aes-256-cfb，更多请查阅<a href=\\\"https://github.com/shadowsocks/shadowsocks/wiki/Encryption\\\" shape=\\\"rect\\\" target=\\\"_blank\\\">Encryption</a></td></tr><tr><td rowspan=\\\"1\\\" style=\\\"border: 1px solid rgb(204, 204, 204); width: 130px; padding: 8px;\\\">fast_open</td><td rowspan=\\\"1\\\" style=\\\"border: 1px solid rgb(204, 204, 204); width: 130px; padding: 8px;\\\">是否启用<a href=\\\"https://github.com/shadowsocks/shadowsocks/wiki/TCP-Fast-Open\\\" shape=\\\"rect\\\" target=\\\"_blank\\\">TCP-Fast-Open</a>，true或者false</td></tr><tr><td rowspan=\\\"1\\\" style=\\\"border: 1px solid rgb(204, 204, 204); width: 130px; padding: 8px;\\\">workers</td><td rowspan=\\\"1\\\" style=\\\"border: 1px solid rgb(204, 204, 204); width: 130px; padding: 8px;\\\"><a href=\\\"https://github.com/shadowsocks/shadowsocks/wiki/Workers\\\" shape=\\\"rect\\\" target=\\\"_blank\\\">worker数量</a>，如果不理解含义请不要改（这个只在Unix和Linux下有用）</td></tr></tbody></table><h2>启动Shadowsocks服务器</h2><div>依次输入以下命令来启动Shadowsocks</div><div><span style=\\\"font-size: 15px; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;\\\"><span style=\\\"font-size: 15px; color: rgb(54, 101, 238); font-family: &quot;Helvetica Neue&quot;, arial, sans-serif;\\\">sudo /usr/local/bin/ssserver -c /etc/shadowsocks/config.json -d start</span></span></div><div><br clear=\\\"none\\\"/></div><div>如果想停止Shadowsocks服务，可以这样停止</div><div><span style=\\\"font-size: 15px; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(54, 101, 238); font-family: &quot;Helvetica Neue&quot;, arial, sans-serif;\\\">sudo /usr/local/bin/ssserver -c /etc/shadowsocks/config.json -d stop</span></div><div><br clear=\\\"none\\\"/></div><div>如果更改了Shadowsocks的配置文件，可以通过restart命令来重启Shadowsocks服务</div><div><span style=\\\"font-size: 15px; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(54, 101, 238); font-family: &quot;Helvetica Neue&quot;, arial, sans-serif;\\\">sudo /usr/local/bin/ssserver -c /etc/shadowsocks/config.json -d restart</span></div><div><br clear=\\\"none\\\"/></div><h2>设置Shadowsocks开机启动</h2><div>服务器运行久了，偶尔需要重启一下，重启时每次都要手动启动hadowsocks的话就太麻烦了，可以将其加到开机启动项。</div><div>sudo vi /etc/rc.local</div><div>将带有<span style=\\\"font-weight: bold;\\\">ssserver</span>内容的行删除，最后加入</div><div><span style=\\\"font-size: 15px; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(54, 101, 238); font-family: &quot;Helvetica Neue&quot;, arial, sans-serif;\\\">sudo /usr/local/bin/ssserver -c /etc/shadowsocks/config.json -d start</span></div><div><br clear=\\\"none\\\"/></div><div>然后保存退出，这样，服务器上的操作就算完成了，接下来改对本地计算机进行操作了。</div><h1><br clear=\\\"none\\\"/></h1><h1>五、取消AWS服务防止到期后正确扣费的正确姿势</h1><div>一言以蔽之，把你账户下所有AWS实例关闭并销毁。如果你因为忘记销毁实例而导致一年之后额外扣费，也可以找客服反应你已经很久没有使用AWS服务了，只是忘记关闭了，客服核实之后会把费用返还你的。</div><div>参考：</div></div><div><br/></div></span>\\\n</div></body></html>\\u0000\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":10933}]"
metadata_diff: {"new":{"id":"de25178b06534e95a0e0beab3a7edd09","parent_id":"061de1401cfc4cfaadf6e74e015970e9","latitude":"0.00000000","longitude":"0.00000000","altitude":"0.0000","author":"","source_url":"","is_todo":0,"todo_due":0,"todo_completed":0,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","application_data":"","order":1764345824778,"markup_language":2,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":0},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2025-11-28T16:20:18.871Z
created_time: 2025-11-28T16:20:18.871Z
type_: 13