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服务器
目录
相关文章
|
1月前
|
安全 大数据 Linux
云上体验最佳的服务器操作系统 - Alibaba Cloud Linux | 飞天技术沙龙-CentOS 迁移替换专场
本次方案的主题是云上体验最佳的服务器操作系统 - Alibaba Cloud Linux ,从 Alibaba Cloud Linux 的产生背景、产品优势以及云上用户使用它享受的技术红利等方面详细进行了介绍。同时,通过国内某社交平台、某快递企业、某手机客户大数据业务 3 大案例,成功助力客户实现弹性扩容能力提升、性能提升、降本增效。 1. 背景介绍 2. 产品介绍 3. 案例分享
|
4月前
|
NoSQL Linux Redis
在 centos7 下重启/开启 redis 服务器
本文提供了一种在Centos 7操作系统下如何重启Redis服务器的步骤,包括停止Redis服务、确认停止成功以及重新启动Redis服务。
266 2
在 centos7 下重启/开启 redis 服务器
|
4月前
|
存储 网络协议 Linux
AWS实操-EC2-创建购买linux(centos)EC2服务器
AWS实操-EC2-创建购买linux(centos)EC2服务器
|
4月前
|
弹性计算 关系型数据库 MySQL
CentOS 7.x操作系统的ECS云服务器上搭建WordPress网站
CentOS 7.x操作系统的ECS云服务器上搭建WordPress网站
|
4月前
|
Ubuntu Linux Windows
Ubuntu 14.04安装samba服务器
Ubuntu 14.04安装samba服务器
45 0
|
4月前
|
Linux 数据安全/隐私保护 Windows
centos 7.2 搭建svn服务器
centos 7.2 搭建svn服务器
135 0
|
5天前
|
缓存 Ubuntu Linux
Linux中yum、rpm、apt-get、wget的区别,yum、rpm、apt-get常用命令,CentOS、Ubuntu中安装wget
通过本文,我们详细了解了 `yum`、`rpm`、`apt-get`和 `wget`的区别、常用命令以及在CentOS和Ubuntu中安装 `wget`的方法。`yum`和 `apt-get`是高层次的包管理器,分别用于RPM系和Debian系发行版,能够自动解决依赖问题;而 `rpm`是低层次的包管理工具,适合处理单个包;`wget`则是一个功能强大的下载工具,适用于各种下载任务。在实际使用中,根据系统类型和任务需求选择合适的工具,可以大大提高工作效率和系统管理的便利性。
54 25
|
15天前
|
监控 Linux PHP
【02】客户端服务端C语言-go语言-web端PHP语言整合内容发布-优雅草网络设备监控系统-2月12日优雅草简化Centos stream8安装zabbix7教程-本搭建教程非docker搭建教程-优雅草solution
【02】客户端服务端C语言-go语言-web端PHP语言整合内容发布-优雅草网络设备监控系统-2月12日优雅草简化Centos stream8安装zabbix7教程-本搭建教程非docker搭建教程-优雅草solution
65 20
|
1月前
|
存储 分布式计算 Hadoop
Centos7.9安装kerberos
Centos7.9安装kerberos
86 25
|
1月前
|
存储 Shell 网络安全
Centos7.9安装openldap
Centos7.9安装openldap
58 16