Slave sshfs access host file system

illustrate

The code needs to be written on the PC host (Linux), and the code must be copied to the slave machine (Linux) every time to compile and run the program. scpCommands are used here scp -r /主机/文件 从机名@192.168.x.x:从机目录/. The use sshfscan be compiled directly on the slave machine, omitting the copy step.

System structure block diagram

Linux master <=====> Linux slave

Steps

  1. host

    • sudo apt-get install openssh-server
    • ifconfig -aGet the IP address in the LAN
  2. Slave

    • sudo apt-get install sshfs
    • sshfs -o idmap=user -o reconnect [email protected]:/path/to/your/workspace /path/to/your/workspace
  3. The hosts file can now be accessed happily from the slave

author : Wangsong
mail : [email protected]

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325476893&siteId=291194637