多用户管理面板 ss-manager 安装教程

By | 2017年9月9日

ss-manager 是一款由 ss 团队开发的多用户管理面板程序,支持 Python 及 libev 版,但官方强烈建议搭配 libev 版使用。相对于 ss-panel 而言,ss-manager 部署安装更为简单,但功能上也有所精简。但如果只是个人分享使用,ss-manager 是完全能够满足需求的。

ss-manager 的安装分为主控机和被控机,均要求已安装好 ss 。有需要的话可以使用一键包进行安装。在安装完成后我们还需要为其准备 node.js 环境,使用以下脚本进行安装即可:

  • curl -sL https://deb.nodesource.com/setup_6.x | bash -
  • apt-get install -y nodejs

随后直接使用 npm 安装 ss-manager:

  • npm i -g shadowsocks-manager

安装完成后新建 ~/.ssmgr 目录,并在其下新建 ss.yml 配置文件:

  • mkdir ~/.ssmgr
  • cd ~/.ssmgr
  • nano ss.yml

内容如下:

type: s
empty: false
shadowsocks:
  address: 127.0.0.1:4000
manager:
  address: 0.0.0.0:4001
  password: '123456'
db: 'ss.sqlite'

其中4000端口为连接 ssmgr 的端口,4001为接受主控机指令的端口,password 为密码,均可以任意更改。

如果是主控机的话,还要新建一个 webgui.yml ,用于启动管理服务。请注意主控机内存要求至少 512M。webgui.yml 内容如下:

type: m
empty: false

manager:
    address: 1.1.1.1:4001
    password: '123456'
plugins:
  flowSaver:
    use: true
  user:
    use: true
  account:
    use: true
  group:
    use: true
  email:
    use: true
    type: 'smtp'
    username: 'username'
    password: 'password'
    host: 'smtp.your-email.com'
  webgui:
    use: true
    host: '0.0.0.0'
    port: '80'
    site: 'http://yourwebsite.com'
    gcmSenderId: '456102641793'
    gcmAPIKey: 'AAAAGzzdqrE:XXXXXXXXXXXXXX'
  alipay:
    use: true
    appid: 2015012108272442
    notifyUrl: 'http://yourwebsite.com/api/user/alipay/callback'
    merchantPrivateKey: 'xxxxxxxxxxxx'
    alipayPublicKey: 'xxxxxxxxxxx'
    gatewayUrl: 'https://openapi.alipay.com/gateway.do'
  paypal:
    use: true
    mode: 'live'
    client_id: 'At9xcGd1t5L6OrICKNnp2g9'
    client_secret: 'EP40s6pQAZmqp_G_nrU9kKY4XaZph'

db: 'webgui.sqlite'

其中 address 为主控机的ip,其后的端口需与 ss.yml 中设置的一致,密码为 ss.yml 中设置的密码。stmp 部分作为发送注册邮件的配置,需要对应填写 smtp 服务器的地址,账号及密码。port 为监听端口,建议配合 Nginx 反代,以实现全站 https

site 为网站地址,按实际填写即可。gcm 部分是 Google Cloud Messaging 接口,可以按需配置。末尾的 alipay 和 paypal 部分为可选项,其中支付宝需要进入商家中心进行签约才能使用。

最后在任意目录新建 ssmgr.sh ,用于后台运行:

  • setsid ss-manager -m aes-256-gcm -u --manager-address 127.0.0.1:4000 &
  • setsid ssmgr -c ~/.ssmgr/ss.yml &
  • setsid ssmgr -c ~/.ssmgr/webgui.yml &

其中端口需要与 ss.yml 中设置的 ssmgr 端口一致。如果是被控机,则删除最后一行。最后使用 nohup 运行 ssmgr.sh 即可开启:

  • nohup ./ssmgr.sh &

此时如不出意外,打开网站后已经添加好了本机节点。ss-manager 的第一个注册用户默认为管理员,登陆后可以在后台继续添加服务器。

如果在启动时出现形如 Cannot find module 的红色报错文字是因为 sqlite 未成功安装,手动安装后重新启动即可:

  • cd /usr/lib/node_modules/shadowsocks-manager/
  • npm install sqlite3 --save

如果需要更新的话直接使用 npm 操作即可:

  • killall node
  • npm update -g shadowsocks-manager

最后使用 ssmgr.sh 重新启动服务。

文末小打一个广告

21 thoughts on “多用户管理面板 ss-manager 安装教程

  1. wangli

    博主你好,我按照你的教程操作,折腾了快一周了 老是出现了下面错误,麻烦你给分析一下什么原因,非常感谢:
    [2018-03-31 23:33:37.963] [ERROR] system – { Error: connect ECONNREFUSED 207.148.112.180:14001
    at Object.exports._errnoException (util.js:1020:11)
    at exports._exceptionWithHostPort (util.js:1043:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1105:14)
    code: ‘ECONNREFUSED’,
    errno: ‘ECONNREFUSED’,
    syscall: ‘connect’,
    address: ‘207.148.112.180’,
    port: 14001 }
    [2018-03-31 23:33:37.972] [ERROR] flowSaver – connect to server abcde@207.148.112.180:14001 fail.

    回复
    1. reizhi 博主

      扫了一下你的ip端口是关闭的,在启动服务端之前,一定要先配置好一个客户端。可以是本机,也可以是其它机器。

      回复
      1. wangli

        你好博主, 是不是 我先配置好该VPS的shadowsocks服务,在找一台电脑或者手机配置好能够正常访问该vps的shadowsocks服务,然后 在进行安装 ss-manager,启动ss.yml和webgui.yml服务?
        小白一只,见笑了。

        回复
        1. reizhi 博主

          ss-manager只是个管理控制台,需要先安装ss本体才能用

          回复
  2. 夏沫

    博主你好, 我按照你的安装方法搭建好后,一切都正常, 就是有个问题:管理员后台无法实时更新数据,手动刷新页面也不行,必须清理cookie后,重新登录后台,才能显示最新的数据,麻烦你给分析下什么原因,非常感谢,感谢!

    回复
  3. IMPR

    在这一步出现了错误。。
    nohup ./ssmgr.sh &

    然后我前台运行了一下:
    root@ubuntu:~# ./ssmgr.sh
    setsid: failed to execute ss-manager: No such file or directory
    root@ubuntu:~# /usr/lib/node_modules/shadowsocks-manager/lib/
    /usr/lib/node_modules/shadowsocks-manager/lib/
    [2018-04-25 21:44:01.643] [INFO] system – System start.
    [2018-04-25 21:44:01.647] [INFO] system – System start.
    [2018-04-25 21:44:01.855] [ERROR] system – { YAMLException: duplicated mapping key at line 6, column 1:
    address: 172.96.199.158:4001
    ^
    at generateError (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:165:10)
    at throwError (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:171:9)
    at storeMappingPair (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:308:7)
    at readBlockMapping (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:1071:9)
    at composeNode (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:1332:12)
    at readDocument (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:1492:3)
    at loadDocuments (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:1548:5)
    at load (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:1569:19)
    at Object.safeLoad (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:1591:10)
    at Object. (/usr/lib/node_modules/shadowsocks-manager/lib/services/config.js:33:19)
    name: ‘YAMLException’,
    reason: ‘duplicated mapping key’,
    mark:
    Mark {
    name: null,
    buffer: ‘type: s\nempty: false\nshadowsocks:\naddress: 127.0.0.1:4000\nmanager:\naddress: 172.96.199.158:4001\npassword: \’synco\’\ndb: \’ss.sqlite\’\n\u0000’,
    position: 67,
    line: 5,
    column: 0 },
    message: ‘duplicated mapping key at line 6, column 1:\n address: 172.96.199.158:4001\n ^’ }
    [2018-04-25 21:44:01.868] [ERROR] system – Caught exception:
    [2018-04-25 21:44:01.868] [ERROR] system – TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.basename (path.js:1361:5)
    at Object. (/usr/lib/node_modules/shadowsocks-manager/lib/init/checkConfig.js:46:18)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    [2018-04-25 21:44:01.885] [ERROR] system – { YAMLException: duplicated mapping key at line 11, column 1:
    use: true
    ^
    at generateError (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:165:10)
    at throwError (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:171:9)
    at storeMappingPair (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:308:7)
    at readBlockMapping (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:1071:9)
    at composeNode (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:1332:12)
    at readDocument (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:1492:3)
    at loadDocuments (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:1548:5)
    at load (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:1569:19)
    at Object.safeLoad (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:1591:10)
    at Object. (/usr/lib/node_modules/shadowsocks-manager/lib/services/config.js:33:19)
    name: ‘YAMLException’,
    reason: ‘duplicated mapping key’,
    mark:
    Mark {
    name: null,
    buffer: ‘type: m\nempty: false\n\nmanager:\naddress: 172.96.199.158:4001\npassword: \’synco\’\nplugins:\nflowSaver:\nuse: true\nuser:\nuse: true\naccount:\nuse: true\nemail:\nuse: true\ntype: \’smtp\’\nusername: \’l@imprfe.cn\’\npassword: \’password\’\nhost: \’smtp.ym.163.com\’\nwebgui:\nuse: true\nhost: \’0.0.0.0\’\nport: \’80\’\nsite: \’http://synco.imprfe.cn\’\ngcmSenderId: \’456102641793\’\ngcmAPIKey: \’AAAAGzzdqrE:XXXXXXXXXXXXXX\’\nalipay:\nuse: false\nappid: 2015012108272442\nnotifyUrl: \’http://yourwebsite.com/api/user/alipay/callback\’\nmerchantPrivateKey: \’xxxxxxxxxxxx\’\nalipayPublicKey: \’xxxxxxxxxxx\’\ngatewayUrl: \’https://openapi.alipay.com/gateway.do\’\npaypal:\nuse: false\nmode: \’live\’\nclient_id: \’At9xcGd1t5L6OrICKNnp2g9\’\nclient_secret: \’EP40s6pQAZmqp_G_nrU9kKY4XaZph\’\n\ndb: \’webgui.sqlite\’\n\u0000’,
    position: 118,
    line: 10,
    column: 0 },
    message: ‘duplicated mapping key at line 11, column 1:\n use: true\n ^’ }
    [2018-04-25 21:44:01.899] [ERROR] system – Caught exception:
    [2018-04-25 21:44:01.899] [ERROR] system – TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.basename (path.js:1361:5)
    at Object. (/usr/lib/node_modules/shadowsocks-manager/lib/init/checkConfig.js:46:18)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)

    求解..

    回复
    1. reizhi 博主

      failed to execute ss-manager: No such file or directory
      试试直接运行ss-manager看看报错,另外贴一下webgui.yml

      回复
        1. reizhi 博主

          请先安装shadowsocks-libev,ss-manager只是一个管理软件,不含ss本体

          回复
  4. 薛清君

    请问ssr可以用这个吗,如果不可以的话,都有什么版本的ss支持这个管理面板,谢谢。

    回复
  5. 不知春秋

    有没有可以在服务器访问的控制器,我搭建的游戏加速ss按流量收费,我怕朋友拿来看YouTube,我想屏蔽掉……

    回复
    1. reizhi 博主

      目前没有现成的工具,建议用iptables封80端口出网

      回复
  6. vlvum

    请教一下这是怎么回事
    [2018-07-11 10:00:36.559] [INFO] system – System start.
    [2018-07-11 10:00:36.569] [INFO] system – System start.
    [2018-07-11 10:00:36.775] [ERROR] system – { YAMLException: end of the stream or a document separator is expected at line 2, column 1:
    empty: false
    ^
    at generateError (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:165:10)
    at throwError (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:171:9)
    at readDocument (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:1512:5)
    at loadDocuments (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:1548:5)
    at load (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:1569:19)
    at Object.safeLoad (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:1591:10)
    at Object. (/usr/lib/node_modules/shadowsocks-manager/lib/services/config.js:33:19)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    name: ‘YAMLException’,
    reason: ‘end of the stream or a document separator is expected’,
    mark:
    Mark {
    name: null,
    buffer: ‘ type: s\nempty: false\nshadowsocks:\n address: 127.0.0.1:4454\nmanager:\n address: 0.0.0.0:4001\n password: \’hentai123.\’\ndb: \’ss.sqlite\’\n\u0000’,
    position: 10,
    line: 1,
    column: 0 },
    message: ‘end of the stream or a document separator is expected at line 2, column 1:\n empty: false\n ^’ }
    [2018-07-11 10:00:36.789] [ERROR] system – Caught exception:
    [2018-07-11 10:00:36.789] [ERROR] system – TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.basename (path.js:1361:5)
    at Object. (/usr/lib/node_modules/shadowsocks-manager/lib/init/checkConfig.js:46:18)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    [2018-07-11 10:00:36.782] [ERROR] system – { YAMLException: bad indentation of a mapping entry at line 36, column 4:
    paypal:
    ^
    at generateError (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:165:10)
    at throwError (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:171:9)
    at readBlockMapping (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:1080:7)
    at composeNode (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:1332:12)
    at readBlockMapping (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:1062:11)
    at composeNode (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:1332:12)
    at readDocument (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:1492:3)
    at loadDocuments (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:1548:5)
    at load (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:1569:19)
    at Object.safeLoad (/usr/lib/node_modules/shadowsocks-manager/node_modules/js-yaml/lib/js-yaml/loader.js:1591:10)
    name: ‘YAMLException’,
    reason: ‘bad indentation of a mapping entry’,
    mark:
    Mark {
    name: null,
    buffer: ‘type: m\nempty: false\n\nmanager:\n address: 0.0.0.0:4001\n password: \’123456\’\nplugins:\n flowSaver:\n use: true\n user:\n use: true\n account:\n use: true\n group:\n use: true\n email:\n use: true\n type: \’smtp\’\n username: \’username\’\n password: \’password\’\n host: \’smtp.your-email.com\’\n webgui:\n use: true\n host: \’0.0.0.0\’\n port: \’80\’\n site: \’http://yourwebsite.com\’\n gcmSenderId: \’456102641793\’\n gcmAPIKey: \’AAAAGzzdqrE:XXXXXXXXXXXXXX\’\n alipay:\n use: true\n appid: 2015012108272442\n notifyUrl: \’http://yourwebsite.com/api/user/alipay/callback\’\n merchantPrivateKey: \’xxxxxxxxxxxx\’\n alipayPublicKey: \’xxxxxxxxxxx\’\n gatewayUrl: \’https://openapi.alipay.com/gateway.do\’\n paypal:\n use: true\n mode: \’live\’\n client_id: \’At9xcGd1t5L6OrICKNnp2g9\’\n client_secret: \’EP40s6pQAZmqp_G_nrU9kKY4XaZph\’\n\ndb: \’webgui.sqlite\’\n\u0000’,
    position: 728,
    line: 35,
    column: 3 },
    message: ‘bad indentation of a mapping entry at line 36, column 4:\n paypal:\n ^’ }
    [2018-07-11 10:00:36.796] [ERROR] system – Caught exception:
    [2018-07-11 10:00:36.796] [ERROR] system – TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.basename (path.js:1361:5)
    at Object. (/usr/lib/node_modules/shadowsocks-manager/lib/init/checkConfig.js:46:18)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)

    回复

发表评论

电子邮件地址不会被公开。 必填项已用*标注