【随笔】linux几类服务挂载

smb://root:security@192.168.1.207/home/smb
ftp://ftpuser:security@192.168.1.207/home/ftp
sftp://root:security@192.168.1.207/home/sftp
nfs://:@192.168.1.207/home/nfs

24.3. Samba协议目录挂载(smb://)
挂载命令:

mount //172.168.1.145/home /mnt/samba

如果挂载出错,根据提示,有可能是因为版本原因的,可以指定版本,如

mount //172.168.1.145/home /mnt/samba -o vers=2.0

需在命令中指定用户名密码挂载的

mount //172.168.1.145/home /mnt/samba -o username=user,password=pwd

mount //192.168.1.207/home/smb /home/gyy -o username=root,password=security
卸载命令:

umount /mnt/samba

24.4. FTP协议目录挂载(ftp://)
Centos下需要安装curlftpfs包,依赖EPEL源:
yum -y install epel-release

yum install curlftpfs

挂载命令:
curlftpfs -o rw,allow_other ftp://ftpuser:security@192.168.1.207//home/ftp /home/mountDir

curlftpfs -o rw,allow_other codepage=utf8 ftp://username:password@192.168.1.168 /mnt/ftp

卸载命令:

umount /mnt/ftp

24.5. SFTP协议目录挂载(sftp://)
凡是开启ssh服务的,都可以挂载。
Centos下需要安装fuse-sshfs包,依赖EPEL源:

yum install fuse-sshfs

挂载命令:
echo security | sshfs root@192.168.1.207:/home/sftp /home/gyy -o password_stdin
echo security | sshfs root@192.168.1.207:/home/sftp /home/IPEARL2.0/java_bin/sfm/data -o password_stdin

sshfs remoteuser@remote.example.com:/home/remoteuser /mnt/ssh

卸载命令:

umount /mnt/ssh

24.6. NFS协议目录挂载(nfs://)
挂载命令:

mount -t nfs 192.168.1.145:/home/nfs /mnt/nfs

卸载命令:

umount /mnt/nfs

服务端安装:
yum install -y nfs-utils rpcbind
mkdir -p /data/nfs-share
cat /etc/exports
vi /etc/exports
新增
/home/nfs *(rw,sync,no_root_squash)
启动
service rpcbind start
service nfs start
测试:
mkdir -p /kubernetes
mount -t nfs 192.168.1.207:/data/nfs-share /home/gyy
umount /home/gyy

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值