1、系统和软件版本
[[email protected] ~]# cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core) [[email protected] ~]# ls samba-4.5.2 samba-4.5.2.tar.gz
2、安装gcc编译器及samba依赖包
[[email protected] ~]# yum -y install gcc perl python-devel gnutls-devel libacl-devel openldap-devel
3、检查系统环境并生成MakeFile
[[email protected] samba-4.5.2]# ./configure
4、编译
[[email protected] samba-4.5.2]#make
5、编译安装
[[email protected] samba-4.5.2]#make install
如果没有报错到这里就安装完成了。
下面是共享的简单配置
6、软件的默认安装目录
[[email protected] samba]# pwd /usr/local/samba
配置文件在:
/usr/local/samba/etc/smb.conf
#smb.conf默认是没有的需要手动创建,示例在安装包samba-4.5.2/examples/smb.conf.default
smb.conf的内容
[global] workgroup = MYGROUP server string = Samba Server server role = standalone server log file = /usr/local/samba/var/log.%m max log size = 50 dns proxy = no [homes] comment = Home Directories browseable = no writable = yes
这段配置默认把用户的家目录共享
新建用户
[[email protected] ~]#useradd test
更改samba用户密码,注意用户密码和samba用户密码不是同一个密码
[[email protected] ~]# /usr/local/samba/bin/smbpasswd -a test
关闭防火墙
[[email protected] ~]# systemctl stop firewalld
启动samba
[[email protected] ~]# /usr/local/samba/sbin/smbd [[email protected] ~]# /usr/local/samba/sbin/nmbd
这个就可以访问了
。
时间: 2024-10-20 23:05:35