博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
samba配置
阅读量:2400 次
发布时间:2019-05-10

本文共 3417 字,大约阅读时间需要 11 分钟。

由于工作需要,需要使用samba在windows下访问linux下的文件,主要是编译环境,linux下使用的是root用户,SSH登陆,而开发是在windows下,代码在windows下开发,为了开发的文件能方便共享,提高开发效率,就折腾了一下samba。

安装samba:yum install samba

开机启动:chkconfig smb on 

              chkconfig smb on

samba添加root用户访问:useradd root(默认已有)

smbpasswd -a root ---后面输入密码

 

配置samba:(主要配置)

[global]	workgroup = SAMBA	security = user	passdb backend = tdbsam	printing = cups	printcap name = cups	load printers = yes	cups options = raw[test]	comment = Home Directories	path=/home/test	valid users = test,root	writable = yes        directory mask = 0775        create mask = 0775        valid users = test,root        write list = test,root        browseable = yes        available = yes[printers]	comment = All Printers	path = /var/tmp	printable = Yes	create mask = 0600	browseable = No[print$]	comment = Printer Drivers	path = /var/lib/samba/drivers	write list = @printadmin root	force group = @printadmin	create mask = 0664	directory mask = 0775

重启samba

service smb restart

windows下清除共享用户名和密码:net use * /delete

windows下访问共享:\\xx.xx.xx.xx\xx

linux下挂载使用命令:

mount.cifs  -o username="test",password="test",sec=ntlmssp  //172.28.107.2/test /opt/rh/

期间使用mount.cifs  -o username="test",password="test"  //172.28.107.2/home/test /opt/rh/有遇到如下问题:

mount.cifs  -o domain="SAMBA",username="test",password="test",sec=ntlm  //172.28.107.6/home/test /opt/ -vmount.cifs kernel mount options: ip=172.28.107.6,unc=\\172.28.107.6\home,sec=ntlm,ver=1,user=test,domain=SAMBA,prefixpath=test,pass=********mount error(13): Permission deniedRefer to the mount.cifs(8) manual page (e.g. man mount.cifs)[root@localhost home]# dmesgStatus code returned 0xc000006d NT_STATUS_LOGON_FAILURECIFS VFS: Send error in SessSetup = -13CIFS VFS: cifs_mount failed w/return code = -13

该问题主要是sec值不对导致,sec具体有

sec=       Security mode. Allowed values are:       ·   none - attempt to connection as a null user (no name)       ·   krb5 - Use Kerberos version 5 authentication       ·   krb5i - Use Kerberos authentication and forcibly enable packet            signing       ·   ntlm - Use NTLM password hashing       ·   ntlmi - Use NTLM password hashing and force packet signing       ·   ntlmv2 - Use NTLMv2 password hashing       ·   ntlmv2i - Use NTLMv2 password hashing and force packet signing       ·   ntlmssp - Use NTLMv2 password hashing encapsulated in Raw NTLMSSP           message       ·   ntlmsspi - Use NTLMv2 password hashing encapsulated in Raw            NTLMSSP message, and force packet signing       The default in mainline kernel versions prior to v3.8 was sec=ntlm.        In v3.8, the default was changed to sec=ntlmssp.

修改mount.cifs -o username="test",password="test",sec=ntlmssp //172.28.107.2/home/test /opt/rh/后又出现如下问题:

[root@localhost home]# mount.cifs  -o domain="SAMBA",username="test",password="test",sec=ntlmssp  //172.28.107.6/home/test /opt/ -vmount.cifs kernel mount options: ip=172.28.107.6,unc=\\172.28.107.6\home,sec=ntlmssp,ver=1,user=test,domain=SAMBA,prefixpath=test,pass=********Retrying with upper case share namemount.cifs kernel mount options: ip=172.28.107.6,unc=\\172.28.107.6\HOME,sec=ntlmssp,ver=1,user=test,domain=SAMBA,prefixpath=TEST,pass=********mount error(6): No such device or addressRefer to the mount.cifs(8) manual page (e.g. man mount.cifs)[root@localhost home]# dmesgStatus code returned 0xc000006d NT_STATUS_LOGON_FAILURECIFS VFS: cifs_mount failed w/return code = -6

该问题主要是没有目录,该目非具体路径,而是samba配置的[test],修改为test后就可以了

 

转载地址:http://vqdob.baihongyu.com/

你可能感兴趣的文章
[转载]JDBC编程基础
查看>>
[转载]Java手机游戏编程之MIDP图形设计篇
查看>>
[转载]Java Servlets编程指南(十八)
查看>>
[转载]实例分析J2ME网络编程的两种方法
查看>>
[转载]java中两个字符串“Equals”和“==”的区别
查看>>
[转载]用Java实现FTP服务器
查看>>
[转载]在Java软件中如何更好防止内存泄漏
查看>>
[转载]简析JAVA的XML编程(to 初学者们)
查看>>
[转载]WebSphere 组件,EJB 技术以及应用服务器的未来
查看>>
[转载]把数字转换成中文货币表示
查看>>
Java抽取Office、PDF的四件兵器
查看>>
[转载]用JBoss Eclipse IDE开发J2EE应用系统
查看>>
[转载]《Effective C#》Item 14:使用构造函数初始化语句
查看>>
[转载]用 Apache Pluto 编写 portlet 并将其部署到 Apache Geronimo 中
查看>>
[转载]关于中文乱码问题的一些解决方案和经验
查看>>
[转载]DB2 Stored Procedure Builder 以及 DB2 Development Center for OS/390 and z/OS 所支持的 JDBC 驱动程序...
查看>>
[转载]在Weblogic上配置Hibernate为JNDI
查看>>
DNS配置全文(转)
查看>>
BIND 9快速安装实例(转)
查看>>
网站综合实例(转)
查看>>