04-ttyd通过浏览器远程连接服务器

@

web页面提供ssh连接。

1. 二进制文件准备

下载连: >>> ttyd-1.6.3.tar.gz

image.png

image.png

2. 安装

2.1 服务安装

  • 将文件拷贝到目标服务器 /usr/bin/ 下,改名为 ttyd
  • 保证对应用户有执行权限
  • 查看结果
[root@iot-server-3 ~]# ttyd -v
ttyd version 1.6.3-3b174da

2.2 服务启动文件

创建 /etc/systemd/system/ttyd.service内容如下:

[Unit]
Description=ttyd
After=network.target
[Service]
ExecStart=/usr/sbin/ttyd -c liubei:liubei@2021 bash
[Install]
WantedBy=multi-user.target

ExecStart 后边 libei使用户名,liubei@2021是密码。

2.3 启动服务

[root@iot-server-3 ~]# systemctl daemon-reload
[root@iot-server-3 ~]# systemctl restart ttyd
  • 查看结果
[root@iot-server-3 ~]# netstat -ntlp|grep ttyd
tcp 0 0 0.0.0.0:7681 0.0.0.0:* LISTEN 2824911/ttyd

posted on   运维开发玄德公  阅读(132)  评论(0编辑  收藏  举报  

相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示