用 Kitty + Ssh + Zellij 作为 Ssh 客户端

ssh 客户端添加心跳包

因为有些路由器喜欢丢弃闲置过长的 TCP 连接 (即不传输任何数据)。

Edit ~/.ssh/config:

1
2
3
4
Host *
    ServerAliveInterval 60
    TCPKeepAlive yes
    IdentitiesOnly yes

添加 ssh Host

Edit ~/.ssh/config:

1
2
3
4
5
Host <alias_name>           # Your preferred alias for this connection
    HostName <host_ip>      # Actual hostname or IP address
    User <user_name>        # Username for authentication
    IdentityFile <private_key_path>  # Path to private key file
    Port 22                 # Optional: SSH port (default is 22)

服务器使用 zellij 防止 ssh 断开而导致耗时比较长的工作中断

zellij 的基本用法:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# New a session
zellij
# OR
zellij new -n mysession

# Detach session
`C-O + D`: detach current session

# Attach session
zellij list-sessions
zellij attach <the_session>

上传/下载文件

在本地使用 scp/rsync 即可。

0%