Stunnel Linux客户端配置

2025-11-03 03:34:02

1、安装stunnel。

推荐使用apt和yum两种安装方式,或者去stunnel官网下载。

2、找到配置文件。

apt方式安装后的路径:/etc/stunnel/stunnel.conf

yum方式安装后的路径:/usr/local/stunnel/stunnel.conf

也可以自定义,然后在客户端启动时指定此配置文件。

Stunnel Linux客户端配置

3、编辑配置文件。

在配置文件中新增如下内容,然后保存退出。

[redis-client]

 client = yes

 accept = 8000

 connect = {弹性IP地址}:{端口}

其中,accept表示stunnel客户端监听的本地端口,connect表示DCS缓存实例开放的互联网地址与端口,可在华为云控制台查询。

Stunnel Linux客户端配置

4、启动客户端。

1.使用了Stunnel默认配置文件,则直接执行命令:

stunnel

2.自定义配置文件的路径,则执行命令:

stunnel /{customdir}/stunnel.conf

其中/{customdir}/stunnel.conf为自定义存储路径。

3.Ubuntu还可以使用 service stunnel4 start 或者systemctl start stunnel4。Stunnel4.x的版本,服务/进程名为stunnel4。

Stunnel Linux客户端配置

5、验证连接。

使用Redis-cli登录,地址填本地地址,端口填配置的自定义端口8000.

Stunnel Linux客户端配置

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢