Samba全攻略:Linux与Windows系统间资源共享利器

需积分: 5 1 下载量 157 浏览量 更新于2024-07-30 收藏 4.45MB DOC 举报
Samba服务攻略深入解析 【Samba原理】 1.1 Samba概述 Samba是一个在Linux与Windows系统间的重要桥梁,它的广泛应用在于其能够实现跨平台的文件和打印机共享,以及提供身份验证和权限管理。Samba作为一个功能强大的服务,最初是通过SMB(Server Message Block)协议连接两个操作系统的,它允许用户在Linux和Windows系统之间自由地复制文件、共享资源,甚至作为域控制器进行域管理工作。通过加密技术,Samba增强了对共享文件和打印机的安全保护。 1.2 Samba应用环境 Samba的核心功能包括文件和打印机共享,通过smbd服务实现网络资源共享,同时支持usermode和domain mode两种身份验证模式,以确保用户访问权限的正确性。此外,Samba通过nmbd服务构建NetBIOS名称解析服务(NBNS),将计算机的NetBIOS名称转化为IP地址,便于网络内的设备互相识别。在局域网中,Samba服务器作为本地主浏览服务器(LMB),提供资源浏览列表,帮助Windows客户端轻松找到共享目录和打印机等网络设备。 1.3 Samba工作原理 Samba基于SMB协议运行,早期依赖NBT协议(NetBIOS over TCP/IP),利用UDP的137、138端口和TCP的139端口进行通信。后来的改进使得Samba可以直接在TCP/IP协议栈上运行,通过TCP的445端口进行数据交换,简化了网络架构。访问Samba服务器的工作流程涉及四个关键步骤:首先,客户端通过negprot指令数据包通知服务器支持的SMB类型,服务器根据这些信息选择合适的协议进行交互,随后进行协议协商、身份验证、权限检查,最后完成文件或打印机操作。 总结来说,Samba是一个不可或缺的工具,尤其在企业环境中,用于实现跨平台的资源共享和管理,其安全性和灵活性使得它成为连接Linux和Windows网络的高效解决方案。了解并掌握Samba的原理和应用对于Linux管理员和开发者来说至关重要。

为什么会这样[user_mongo@nosql01 replicaset]$ cd /opt [user_mongo@nosql01 opt]$ ll total 0 drwxr-xr-x. 3 root root 25 Mar 16 17:08 servers drwxr-xr-x. 2 root root 51 Mar 16 17:10 software [user_mongo@nosql01 opt]$ tar -zxvf /opt/software/mongodb-linux-x86_64-rhel70-4.4.12.tgz -C /opt/servers/mongodb_demo/replicaset/ mongodb-linux-x86_64-rhel70-4.4.12/LICENSE-Community.txt tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/LICENSE-Community.txt: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/MPL-2 tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/MPL-2: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/README tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/README: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/THIRD-PARTY-NOTICES tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/THIRD-PARTY-NOTICES: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/bin/install_compass tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/bin/install_compass: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/bin/mongo tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/bin/mongo: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/bin/mongod tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/bin/mongod: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/bin/mongos tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/bin/mongos: Cannot open: No such file or directory tar: Exiting with failure status due to previous errors [user_mongo@nosql01 opt]$ tar -zcvf /opt/software/mongodb-linux-x86_64-rhel70-4.4.12.tgz -C /opt/servers/mongodb_demo/replicaset/ tar: Cowardly refusing to create an empty archive Try `tar --help' or `tar --usage' for more information.

2023-06-01 上传