Fish in the river

思考 技术
记录 回忆
  1. Main page
  2. 运维技术
  3. Linux
  4. Main content

CentOS中安装Samba

2024年8月28日 80hotness 0likes 0comments

安装好Centos后,不可避免的要和Windows系统互相传送文件。而在两个平台间传送文件最简单的方法就是在Centos平台上安装Samba服务。

以下是在Centos平台上安装Samba服务的要点概述。

1. 确保Linux防火墙关闭

sudo systemctl status firewalld

sudo systemctl stop firewalld

sudo systemctl disabled firewalld

2.确保Selinux功能关闭

打开/etc/sysconfig/selinux文件,设置SELINUX=0。

3.新建一个共享文件夹,比如Share。

4.安装Samba服务。

5.配置Samba的配置文件/etc/samba/smb.conf,增加以下内容。

[share]
path = /home/joey/share
read only = no
valid users = joey

6.将当前系统中的已存在用户,添加到samba用户数据库中。注意此用户要具有在第3步中建立的共享文件夹的读写权限。

smbpasswd -a joey

最后特别注意,第二点。

我就发现,所有的Samba都配置好了,通过Windows访问时,也能看到共享的目录,但当我点击共享的目录时提示没有权限。

我当时还以为是我添加到Samba用户库中的用户,不具备对这个目录的读写权限。一通捣鼓后,发现原来是Selinux这个设置搞的鬼。

所以特别提出来说明。

 

Tag: Linux
Last updated:2024年8月28日

joey

This person is a lazy dog and has left nothing

Like
< Last article
Next article >

Comments

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
Cancel

归档

  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024

分类目录

  • C#
  • Dock
  • Excel
  • Kindle
  • Linux
  • Windows
  • 生活感悟
  • 群晖
  • 运维技术

COPYRIGHT © 2024 水中小鱼. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang