标签 firewall 下的文章

说明:ss-panel-v3使用的SMTP发邮件,之前阿里云国际版用465端口正常,迁移到DigitalOcean不能使用25和465给客服发ticket,得到的回复如下:

[scode type="share"]Thank you for reaching out to us. We're very sorry that you are facing issues with SMTP.

Stopping spam is a constant fight and due to this, your account has restrictions specifically on ports 25 and 465. However, you are be able to send out mail using port 587. You will need to open the port in your firewall.

We realize this is inconvenient, but many customers in your position move their mailing activities to a third party service such as SendGrid or similar which processes such mail separately from their droplet. I'm sorry for the frustration but we're not able to lift these port restrictions at this time.

In terms of a workaround, here are a few alternatives:

  1. Utilize port 587 for SMTP relay via another mail provider, for example G Suite/Gmail, Mailgun, etc. We have a guide on doing so using Postfix here:

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-mail-relay-with-postfix-and-mailgun-on-ubuntu-16-04

  1. Configure your app or service to send mail directly using either a SMTP client connection (typically using port 587), or API call via another mail provider such as Sendgrid, Mailgun, Mandrill, etc.

Please note that with this restriction in place on port 25, mail servers hosted here will be unable to directly relay email to other mail servers, as communication between mail servers typically takes place on port 25.

We think the API is the best solution, as it is honestly more scalable and what we would use if we wanted to "future proof" the project.

Please feel free to reach out to us via this ticket if you have further queries or concerns, we will be around to help you out!

Regards,

Saurabh
Developer Support Specialist - DigitalOcean

(Check out our fantastic community articles: https://www.digitalocean.com/community)[/scode]
所以决定使用Gmail的587来发送邮件。

开启IMAP

1.在计算机上打开 Gmail。
2.点击右上方的“设置”图标。
3.点击转发和 POP/IMAP 标签。
4.在“IMAP 访问”部分,点击启用 IMAP。
5.点击保存更改。

开启安全性较低的应用的访问权限

直达链接:https://myaccount.google.com/lesssecureapps

SMTP设置

发送邮件 (SMTP) 服务器:smtp.gmail.com
要求 SSL:是
要求 TLS:是(如适用)
使用身份验证:是
TLS/STARTTLS 端口:587
完整名称或显示名称:您的姓名
帐号名、用户名或电子邮件地址:您的完整电子邮件地址
密码:您的 Gmail 密码

简介

5hadow5ocksR 多用户版服务端安装记录(S*S-Panel后端)

安装环境

1.centos 7.3
2.阿里云国际版sg

基本库安装

yum update
yum install git -y

获取源代码

git clone -b manyuser https://github.com/ToyoDAdoubi/shadowsocksr.git

注意:根目录的是多用户版(即数据库版)[shadowsocksr];子目录中的是单用户版[shadowsocksr/shadowsocksr]

安装依赖(cymysql)

cd shadowsocksr
# 进入ShadowsocksR根目录
bash setup_cymysql.sh
# 安装Cymysql 依赖
bash initcfg.sh
# 初始化ShadowsocksR服务端

服务端配置

shadowsocksr 根目录内,打开文件vi usermysql.json,输入i进入编辑状态,esc退出编辑,:wq保存退出

"host": "127.0.0.1", //前端mysql域名/IP
"port": 3306, //mysql端口
"user": "ss", //mysql用户名
"password": "pass", //mysql密码
"db": "shadowsocks", //数据库名

注意:host如果在其他主机,要添加本机的访问权限。

配置文件config.json

一般情况下不需要编辑,除非你需要修改 加密方式/协议/混淆等参数。

vi user-config.json

注意:新版ShadowsocksR服务端的 默认加密方式为 aes-128-ctr ,大家注意一下。
"method":"aes-128-ctr", //修改成您要的加密方式的名称
"protocol": "auth_aes128_md5", //修改成您要的协议插件名称
"obfs": "tls1.2_ticket_auth_compatible", //修改成您要的混淆插件名称

服务端运行与停止

python server.py

这句运行代码主要用于调试,关闭ssh后ss后端自动关闭,所以正式使用请使用下面的脚本运行!
如果需要停止请按Ctrl+C键终止程序。

firewall(centos7)的防火墙配置

服务端没有错误,而连接不上,需要检查iptables或firewall(centos7)的防火墙配置

systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动

添加安全组规则

1.阿里云控制台中实例选择“管理”
2.依次点击“本实例安全组”=>“配置规则”=>“添加安全组规则”
3.把s*s端口添加进去
image

开机启动

chmod +x /etc/rc.d/rc.local
#首先设置开机启动文件的权限
vi /etc/rc.d/rc.local
#编辑文件,按i进入编辑模式
bash /root/shadowsocksr/run.sh
#添加开机启动命令,按esc退出编辑模式,输入 :wq 保存退出

来源:https://doub.io/ss-jc14/