个人笔记记录(常用)

个人笔记


Linux文件共享服务

<h3>sshfs -- NFS -- samba</h3> <p><strong>sshfs客户端安装,服务端无需安装</strong></p> <pre><code>yum -y install fuse-sshfs sshfs</code></pre> <p><strong>挂载远端ssh指定目录</strong></p> <pre><code>mkdir /backups/150 /usr/bin/sshfs -o nonempty,allow_other,exec,reconnect root@192.168.0.150:/backups/svn /mnt/150</code></pre> <p><strong>查看当前系统挂载</strong></p> <pre><code>cat /etc/mtab</code></pre> <p><strong>添加到自动挂载</strong></p> <pre><code>vim /etc/fstab root@192.168.1.121:/test/ /test/zjy fuse.sshfs rw,nosuid,nodev,allow_other 0 0 #若通过ssh密钥认证可直接添加开机启动自动挂载即可 crontab -e @reboot (/usr/bin/sshfs -o nonempty,allow_other,exec root@172.16.2.150:/home /backups/150 -o reconnect)</code></pre> <p><strong>强制卸载</strong></p> <pre><code>umount -fl /backups/150</code></pre> <p>如果卸载后权限出现???则再umount一次即可 <strong>设置开机自动挂载</strong></p> <pre><code>vim /etc/fstab #加入下面一行 sshfs#root@172.16.2.150:/home /backups/150 fuse defaults,auto,allow_other 0 0 #如果服务器配置为基于SSH密钥的认证方式,则/etc/fstab中加入如下行: sshfs#root@172.16.2.150:/home /backups/150 fuse IdentityFile=~/.ssh/id_rsa defaults,auto,allow_other 0 0</code></pre> <hr /> <ul> <li> <p><strong>创建ssh密钥,直接按3次回车即可</strong></p> <p>ssh-keygen</p> </li> <li> <p><strong>上传密钥至服务器,输入一次密码即可</strong></p> <p>ssh-copy-id -i ~/.ssh/id_rsa.pub '-p 22 root@172.16.2.150'</p> </li> <li> <p><strong>登录服务器,无需密码</strong></p> <p>ssh root@172.16.2.150</p> </li> </ul> <hr /> <h3><a href="https://blog.csdn.net/weixin_34146410/article/details/89050608">Windows下实现Dokan+SSHFS</a></h3> <p>使用sersync +rsync进行实时文件同步</p> <p><a href="https://www.xiebruce.top/753.html">https://www.xiebruce.top/753.html</a></p> <p>ssh挂载(sshfs)</p> <p><a href="https://blog.csdn.net/sunny05296/article/details/77722081">https://blog.csdn.net/sunny05296/article/details/77722081</a></p> <p><a href="https://blog.csdn.net/abao623660072/article/details/6565014">https://blog.csdn.net/abao623660072/article/details/6565014</a></p>

页面列表

ITEM_HTML