Mount CIFS

简介:
mount -t cifs -o username="共享用户",password="密码" //ip/sharing_folder /mountpoint

  
   1 mount -o username=your_name,password=your_password //server/share_folder /mount_point
   2 mount -t cifs username=your_name,password=your_password //server/share_folder /mount_point
   这两种方法本质都一样,但要注意your_name用户必须对share_folder拥有完全操作的权限,当然若要只读甚至随便乱写个用户名密码都可 以。
   3 写到/etc/fstab文件中,在该文件最后添加一行:
   //server/share_folder /mount_point  cifs username,password,rw 
   这样还是有个缺点,即用户名和密码都以明文的方式暴露了,还可以这样:
   4 编辑/etc/fstab,按如下格式添加:
   //server/share_folder /mount_point  cifs credential=/root/credential
     而/root/credential中内容如下:
     useername=your_name
     password=your_password
   但是还有个问题,普通用户是无权使用mount的,
   5 使用sudo

   6 对mount.cifs添加suid。



本文转自莫水千流博客园博客,原文链接:http://www.cnblogs.com/zhoug2020/p/3993178.html,如需转载请自行联系原作者

相关文章
|
5月前
|
Unix Linux 文件存储
文件传输、文件挂载MOUNT:NFS、CIFS、ADB、SAMBA
文件传输、文件挂载MOUNT:NFS、CIFS、ADB、SAMBA
175 0
|
5月前
|
Linux Windows
mount/umount 挂载/卸载
mount/umount 挂载/卸载。
60 9
|
Web App开发 关系型数据库 MySQL