centos 5.6 简单搭建samba服务器

简介: <div style="top:0px"> <p style="line-height:23px; font-family:Arial; font-size:14px; margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px"> </p> <p style="line-height:23.8px;


centos 5.6 


Samba是Unix/Linux下与Windows通信的一个开源软件,在RHEL5下是默认安装好其客户端的,我当前系统是CentOS5.6 x86-64

  1. [root@tongji_bak ~]# cat /etc/issue  
  2. CentOS release 5.6 (Final)  
  3. Kernel \r on an \m  
  4.   
  5. [root@tongji_bak ~]# rpm -qa|grep samba  
  6. samba-client-3.0.33-3.29.el5_5.1  
  7. samba-common-3.0.33-3.29.el5_5.1  
  8. [root@tongji_bak ~]#  

在CentOS5.6介质中找到samba-3.0.33-3.29.el5_5.1.x86_64.rpm并且安装

  1. [root@tongji_bak opt]# ll  
  2. 总计 16716  
  3. -rw-r--r-- 1 root root 17091778 10-24 21:14 samba-3.0.33-3.29.el5_5.1.x86_64.rpm  
  4. [root@tongji_bak opt]# rpm -ivh samba-3.0.33-3.29.el5_5.1.x86_64.rpm   
  5. warning: samba-3.0.33-3.29.el5_5.1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID e8562897  
  6. error: Failed dependencies:  
  7.     perl(Convert::ASN1) is needed by samba-3.0.33-3.29.el5_5.1.x86_64  
  8. [root@tongji_bak opt]#  

如果出现以上安装错误,需要先安装perl-Convert-ASN1-0.20-1.1.noarch.rpm

  1. [root@tongji_bak opt]# ll  
  2. 总计 16760  
  3. -rw-r--r-- 1 root root    42523 10-24 21:19 perl-Convert-ASN1-0.20-1.1.noarch.rpm  
  4. -rw-r--r-- 1 root root 17091778 10-24 21:14 samba-3.0.33-3.29.el5_5.1.x86_64.rpm  
  5. [root@tongji_bak opt]# rpm -ivh perl-Convert-ASN1-0.20-1.1.noarch.rpm   
  6. warning: perl-Convert-ASN1-0.20-1.1.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897  
  7. Preparing...                ########################################### [100%]  
  8.    1:perl-Convert-ASN1      ########################################### [100%]  
  9. [root@tongji_bak opt]# rpm -ivh samba-3.0.33-3.29.el5_5.1.x86_64.rpm   
  10. warning: samba-3.0.33-3.29.el5_5.1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID e8562897  
  11. Preparing...                ########################################### [100%]  
  12.    1:samba                  ########################################### [100%]  
  13. [root@tongji_bak opt]#  

samba安装成功,启动samba服务

  1. [root@tongji_bak opt]# /etc/rc.d/init.d/smb start  
  2. 启动 SMB 服务:                                            [确定]  
  3. 启动 NMB 服务:                                            [确定]  
  4. [root@tongji_bak opt]#  

查看samba监听的端口

  1. [root@tongji_bak opt]# netstat -anp|grep smbd  
  2. tcp        0      0 0.0.0.0:139                 0.0.0.0:*                   LISTEN      17839/smbd            
  3. tcp        0      0 0.0.0.0:445                 0.0.0.0:*                   LISTEN      17839/smbd            
  4. unix  2      [ ]         DGRAM                    121836 17839/smbd            
  5. [root@tongji_bak opt]# netstat -anp|grep nmbd  
  6. udp        0      0 192.168.107.190:137         0.0.0.0:*                               17842/nmbd            
  7. udp        0      0 0.0.0.0:137                 0.0.0.0:*                               17842/nmbd            
  8. udp        0      0 192.168.107.190:138         0.0.0.0:*                               17842/nmbd            
  9. udp        0      0 0.0.0.0:138                 0.0.0.0:*                               17842/nmbd            
  10. [root@tongji_bak opt]#  

测试Windows客户端能否访问samba服务器,输入服务器IP看见以下图片,说明通信成功,注意不能直接使用OS用户登录


创建samba用户

  1. [root@tongji_bak opt]# useradd smbuser1  
  2. [root@tongji_bak opt]# passwd smbuser1  
  3. Changing password for user smbuser1.  
  4. New UNIX password:   
  5. BAD PASSWORD: it is based on a dictionary word  
  6. Retype new UNIX password:   
  7. passwd: all authentication tokens updated successfully.  
  8. [root@tongji_bak opt]# smbpasswd -a smbuser1  
  9. New SMB password:  
  10. Retype new SMB password:  
  11. Added user smbuser1.  
  12. [root@tongji_bak opt]#  

添加的samba用户都是在OS的一个文件当中,我们可以通过以下命令查看

  1. [root@tongji_bak opt]# more /etc/samba/passdb.tdb   
  2. TDB file  
  3.   
  4. ser1  
  5. smbuser1  

使用smbuser1用户登录,访问samba服务器
目录
相关文章
|
2月前
|
缓存 关系型数据库 MySQL
百度搜索:蓝易云【CentOS8服务器安装MySQL报错:no match mysql-community-server】
现在,你已经成功安装了MySQL服务器并解决了"no match mysql-community-server"的报错问题。祝你使用愉快!
43 1
|
3月前
|
Linux
CentOS7.9服务器一键脚本部署FRP内网穿透服务端与客户端
CentOS7.9服务器一键脚本部署FRP内网穿透服务端与客户端
219 0
|
2月前
|
监控 安全 Linux
深入探讨Samba服务器的配置与使用
深入探讨Samba服务器的配置与使用
159 0
|
15天前
|
Linux
centos 查看服务器信息 版本cpu
centos 查看服务器信息 版本cpu
11 0
|
23天前
|
Ubuntu Linux 虚拟化
【Linux】ubuntu安装samba服务器
【Linux】ubuntu安装samba服务器
|
1月前
|
Oracle 关系型数据库 Linux
服务器Centos7 静默安装Oracle Database 12.2
服务器Centos7 静默安装Oracle Database 12.2
83 0
|
1月前
|
存储 弹性计算 Linux
阿里云ECS(CentOS镜像)安装docker
阿里云ECS(CentOS镜像)安装docker
382 0
|
6月前
|
Linux 网络安全 数据安全/隐私保护
如何在 CentOS 上安装和配置 Samba?
如何在 CentOS 上安装和配置 Samba?
650 0
如何在 CentOS 上安装和配置 Samba?
|
Linux 网络安全 数据安全/隐私保护
linux篇-centos7安装samba服务器
linux篇-centos7安装samba服务器
174 0
linux篇-centos7安装samba服务器