版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明 (作者:张华 发表于:2021-07-16)
cat << EOF | sudo tee /bak/bin/sshpass.sh
#!/bin/bash
sshpass -f /home/hua/.pwd ssh $*
EOF
chmod +x /bak/bin/sshpass.sh
#sshfs -o password_stdin hua@win:G:\share /mnt/win <<< 'password'
sshfs -o reconnect,allow_other,follow_symlinks,ssh_command='/bak/bin/sshpass.sh' hua@win:G:\share /mnt/win#autofs
/mnt/win -fstype=fuse,port=22,reconnect,allow_other,follow_symlinks,ssh_command=/bak/bin/sshpass.sh :sshfs\#hua@win\:G:\share#/etc/fstab
sshfs#hua@win:G:\share /mnt/win fuse ssh_command=/bak/bin/sshpass.sh 0 0
sudm mount -a$ sudo cat /etc/auto.master |tail -n1
/- auto.direct
$ sudo cat /etc/auto.direct
/nas -fstype=nfs4,rsize=32768,wsize=32768 nas:/Public
/mnt/win_share win:/win_share
/mnt/win_bak win:/win_bak
# DEV_NAME=$(readlink /dev/disk/by-path/ip-192.168.2.108\:3260-iscsi-iqn.2020-11.com.quqi\:catdisk.share-lun-1 |xargs basename)
#/bakiscsi -fstype=ext4,rw,nosuid,nodev :/dev/sdc1
#/mnt/samba -fstype=cifs,rw,username=root,password=password,vers=1.0,file_mode=0777,dir_mode=0777 ://192.168.2.47/share
/mnt/win -fstype=fuse,port=22,reconnect,allow_other,follow_symlinks,ssh_command=/bak/bin/sshpass.sh :sshfs\#hua@win\:G:\\share