標籤:sshfs mount
項目有台online機器需要遷移到另外1台上去 上面有多個不同目錄需要scp到另外1台上去 發現使用sshfs一次性的將目錄掛載過來 在本地複製後在umount這樣省事也方便,也省去每次scp需要敲密碼了。基礎環境severA=192.168.1.122(6.0.10)debian severB=192.168.1.120(6.6)centos1、安裝sshfs(SSHFS - filesystem client based on ssh)apt-get -y install sshfs2、掛載格式sshfs [[email protected]]host:[dir] mountpoint [options]3、將severB機器上的/opt/111目錄掛載到severA的/mnt下echo "redhat"|sshfs -o nonempty,allow_other,password_stdin [email protected]:/opt/111 /mnt4、參數說明-o password_stdin read password from stdin (only for pam_mount!)-o nonempty allow mounts over non-empty file/dir-o allow_other allow access to other users5、查看掛載df -ThFilesystem Type Size Used Avail Use% Mounted on/dev/sda1 ext3 19G 2.1G 16G 12% /tmpfs tmpfs 494M 0 494M 0% /lib/init/rwudev tmpfs 490M 156K 490M 1% /devtmpfs tmpfs 494M 0 494M 0% /dev/shm/dev/sda5 ext3 31G 179M 30G 1% /opt[email protected]:/opt/111 fuse.sshfs 26G 244M 25G 1% /mnt==========================centos===========================centos直接yum安裝(前提是有epel源)1、查詢yum list |grep sshfsfuse-sshfs.x86_64 2.4-1.el6 epel2、安裝yum -y install fuse-sshfs
本文出自 “7928217” 部落格,請務必保留此出處http://7938217.blog.51cto.com/7928217/1661793
sshfs命令掛載遠程目錄(debian centos)