Ubuntu下挂载远程目录方法
来源:互联网 发布:java初学者源代码 编辑:程序博客网 时间:2024/06/05 17:44
1.ssh
当我们需要管理一台远程的linux服务器的时候经常使用的是比较安全的ssh。
以下是通过ssh挂在远程目录的方法:
:~$ sudo apt-get install sshfs fuse :~$ sshfs <username>@<ipaddress>:/remotepath ~/remoteserv -o allow_other若提示一下错误:fusermount: option allow_other only allowed if 'user_allow_other' is set in /etc/fuse.conf则在/etc/fuse.conf中添加user_allow_other如需自动挂载,可以在/etc/fstab中添加如下代码:sshfs#username@ipaddress:/remotepath ~/remoteserv fuse user,_netdev,exec,reconnect,uid=1000,gid=1000,idmap=user,allow_other 0 0如果挂载没有效果,可以查看日志了,sshd的日志在:/var/log/auth.log:Aug 8 11:05:21 localhost sshd[21595]: Authentication refused: bad ownership or modes for directory /remotepath此时一般是remotepath目录的权限错误,一般该目录的权限应为700或755,不能为77x。
2.nfs
服务器端: 172.21.10.68
:~$ sudo apt-get install nfs-kernel-server portmap //安装nfs portmap:~$ sudo vi /etc/exports //配置nfs# /etc/exports: the access control list for filesystems which may be exported# to NFS clients. See exports(5).## Example for NFSv2 and NFSv3:# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)## Example for NFSv4:# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)##Add Next Line //feison/home/feison/nfs *(rw,sync,no_root_squash,no_subtree_check) :wq:~$ sudo service nfs restart //启动nfs服务:~$ sudo service portmap start //启动portmap服务
客户端:
:~$ sudo apt-get install nfs-kernel-server:~$ sudo mount -t nfs 172.21.10.68:/home/feison/nfs ./nfs:~$ sudo umount ./nfs如果出现:mount: mount to NFS server 'p470-1' failed: RPC Error: Program not registered是服务端的服务没有启动,重新启动服务即可。
1 0
- Ubuntu下挂载远程目录方法
- ubuntu 远程登录ubuntu服务器的方法
- ubuntu下如何查看远程主机的共享目录
- Ubuntu开机挂载samba远程共享目录
- Ubuntu下使用sshfs挂载远程目录到本地
- Ubuntu挂载远程共享目录到本地
- linux(ubuntu)挂载远程目录到本地
- ubuntu mysql 远程连接问题解决方法
- Ubuntu远程登录方法之一 ---------- SSH Server
- ubuntu mysql远程连接问题解决方法
- Ubuntu开启远程控制的方法
- Xshell远程链接ubuntu的方法
- Ubuntu设置远程链接的方法
- Ubuntu通过Samba共享Windows目录方法
- ubuntu 中修改目录所有者的方法
- ubuntu中找jdk的目录方法
- Linux操作系统下挂载远程Windows共享目录
- Linux下挂载远程Windows共享目录
- tabhost+滚动条的效果实现
- 算法中常见时间复杂度的比较
- iOS相关,过年回来电脑上的证书都失效了,求大神!
- xilinx千兆以太网与万兆以太网IP接口
- HBase shell的基本用法
- Ubuntu下挂载远程目录方法
- 1063. Set Similarity (25)
- Salt-api调用模块saltapi.py
- 再谈spring mvc中的root/child WebApplicationContext
- openwrt /etc/config/network
- UVA253 Cube painting
- ADB的学习
- 工厂模式
- moveTaskToBack Android应用退到后台,类似按下Home键