0%

sshfs + Barrier 实现一套键跨平台多机控制

1. sshfs

sshfs(Secure SHell FileSystem) 是一个客户端,可以让我们通过 SSH 文件传输协议(SFTP) 挂载远程的文件系统并且在本地机器上和远程的目录和文件进行交互

1.1 安装

以 ubuntu 为例

1
sudo apt-get install sshfs

1.2 修改本地映射文件夹权限

1
2
mkdir /xxx/xxx # 创建一个文件夹用来挂载,如 ~/Documents/local_path
chmod 777 /xxx/xxx # 将该文件夹权限修改为 777

1.3 挂载

1
sshfs -o allow_other user@xxx.xxx.x.xx:/remote/path /local/path

1.4 取消挂载

1
fusermount -u /local/path # 挂载文件夹的绝对路径

2. Barrier

跨平台不同设备间共享键鼠的一个工具。

2.1 安装

两边都需要安装 Barrier,下面以 Ubuntu 安装为例:

1
sudo apt-get install barrier

2.2 设置

  1. 两边都关闭 SSL:打开 Barrier - 左上角 Barrier - 更改设置 - 取消勾选 SSL
    barrier1.png

  2. 配置服务端和客户端

    • Local(控制方)作为服务端
      1. 打开 Barrier
      2. 勾选【服务端】
      3. 【交互配置】 -【设置服务端】- 拖动屏幕设置屏幕名和布局
        barrier3.png
      4. 记住 服务端 IP 地址
      5. 点击启用
    • Remote(被控制方)作为客户端
      1. 打开 Barrier
      2. 勾选【客户端】
      3. 填写服务端 IP 地址
      4. 点击启用
    • 启用成功后会显示【Barrier正在运行】
      barrier2.png