赞
踩
**下载:
下载samba的源码包地址:http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/14/Everything/source/SRPMS/
system-config-samba-1.2.90-1.fc14.src.rpm
system-config-samba-docs-1.0.9-1.fc14.src.rpm
**安装
1、进入root模式下su
2、安装 rpm-build 的编译工具,目的是编译 rpm 包
yum install -y rpm-build
3、对源码包进行编译
rpmbuild --rebuild system-config-samba-1.2.90-1.fc14.src.rpm
rpmbuild --rebuild system-config-samba-docs-1.0.9-1.fc14.src.rpm
注意:在编译过程中会提示错误信息,请根据对应的提示安装对应的依赖包
比如: yum install -y gnome-doc-utils
4、编译结束了,打开目录/root/rpmbuild/RPMS/noarch/即可看到两个已经编译好的包
rpm -ivh system-config-samba-1.2.90-1.el6.noarch.rpm system-config-samba-docs-1.0.9-1.el6.noarch.rpm
5、执行命令 system-config-samba
*****即可看到一个漂亮的samba图形化界面
6、关闭防火墙和selinux
修改/etc/sysconfig/selinux文件下的参数;将SELINUX=enforcing改为SELINUX=disable;然后执行
setenforce 0命令执行
getenforce 查看selinux状态为Permissive就行了
7、在配置文件下的配置参数(/etc/samba/smb.conf)
# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.
[global]
workgroup = samba
server string = Samba Server Version %v
netbios name = Linuxidc-Server
log file = /var/log/samba/%m.log
max log size = 10240
security = user
; passdb backend = tdbsam
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = 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
[workspace]
# 共享文件目录描述
comment = Shared Directories
# 共享文件目录
path = /home/edu/workspace
# 是否允许guest访问
public = yes
# 指定管理用户
admin users = edu
# 可访问的用户组、用户
valid users = edu
# 是否浏览权限
browseable = yes
# 是否可写权限
writable = yes
# 文件权限设置
create mask = 0777
directory mask = 0777
force directory mode = 0777
force create mode = 0777
8、操作命令
systemctl start smb.service //启动
systemctl stop smb.service //关闭
systemctl status smb.service //查看状态
systemctl restart smb.service //重启服务器
注意:如果系统不能添加登录用户账号可以通过命令行在root下进行添加:
->smbpasswd -a root
->input passwd
****************************************************************************************************************************************
****************************************************************************************************************************************
- 1、安装服务器:
- sudo apt-get install samba
- sudo apt-get install cifs-utils
- sudo apt-get install samba-common
- 安装samba界面:sudo apt-get install system-config-samba
- 执行: sudo system-config-samba
- 注意:如果报错缺少 /etc/libuser.conf文件
- sudo touch /etc/libuser.conf
- 2、###### 配置文件
- ###### sudo gedit /etc/samba/smb.conf
- [share]
- # 共享的文件夹
- comment = share
- path = /home/ubuntu/share
- ; available = yes
- # 用户
- writeable = yes
- ; browseable = yes
-
- # 设置Samba上写入文件或目录的用户权限
- create mask = 666
- directory mask = 777
- valid users = ubuntu
-
- ######重启samba服务器:sudo service smbd restart
-
- 配置完成后登录时:用户名:ubuntu
- 密码123(根据实际设置为主)
-
命令:
sudo adduser samba_user //添加samba用户
sudo smbpasswd -a samba_user //设置samba用户密码
问题:
1、免密登陆设置或者一直登录不上去提示密码或用户名错误
屏蔽掉/etc/samba/smb.conf配置文件里:
86 ; usershare allow guests = yes
187 ; security = user
188 ; encrypt passwords = no
189 ; guest ok = no
190 ; guest account = nobody
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。