redhat7.5配置samba

参考链接:https://blog.csdn.net/spy_h/article/details/80921711
redhat7.5配置samba很容易出问题,下边的文章记录我的samba配置情况,这里记录一下
这里使用的通过用户共享的模式:
步骤一:配置samba(若没有samba 使用yum install smb)
(因为我共享的为自己家目录下的,直接用了原有的homes,smbuser可以加也可以不加)
redhat7.5配置samba_第1张图片
步骤二:
如果配置中新增了访问用户 例如smbuser ,则需要新增用户smbuser
user add smbuser
再给需要访问的用户权限
smbpaswd -a smbuser

亦可使用pdbedit查看smb用户名修改smb用户名密码

PDBEDIT(8)                                                                                            System Administration tools                                                                                           PDBEDIT(8)

NAME
       pdbedit - manage the SAM database (Database of Samba Users)

SYNOPSIS
       pdbedit [-a] [-b passdb-backend] [-c account-control] [-C value] [-d debuglevel] [-D drive] [-e passdb-backend] [-f fullname] [--force-initialized-passwords] [-g] [-h homedir] [-i passdb-backend] [-I domain] [-K] [-L] [-m]
        [-M SID|RID] [-N description] [-P account-policy] [-p profile] [--policies-reset] [-r] [-s configfile] [-S script] [--set-nt-hash] [-t] [--time-format] [-u username] [-U SID|RID] [-v] [-V] [-w] [-x] [-y] [-z] [-Z]

DESCRIPTION
       This tool is part of the samba(7) suite.

       The pdbedit program is used to manage the users accounts stored in the sam database and can only be run by root.

       The pdbedit tool uses the passdb modular interface and is independent from the kind of users database used (currently there are smbpasswd, ldap, nis+ and tdb based and more can be added without changing the tool).

       There are five main ways to use pdbedit: adding a user account, removing a user account, modifying a user account, listing user accounts, importing users accounts.

OPTIONS
       -L|--list
           This option lists all the user accounts present in the users database. This option prints a list of user/uid pairs separated by the ':' character.

           Example: pdbedit -L

               sorce:500:Simo Sorce
               samba:45:Test User

步骤三:
如果是smbuser的话 可能会因为没有访问共享文件的权限而无法访问文件,可以将smbuser增加到有访问权限的用户组中。
usermod-g用户组用户名 强行设置某个用户所在组
步骤四:
关闭防火墙:sudo iptables -F
设置slinux:sudo setenforce 0
启动smb: sudo service smb restart
步骤五:
测试:
smbclient -admin //192.168.178.149/admin(在linux查看win访问情况)
或者 直接使用
win的映射情况查看咯
需要输入账号和密码
ps:如果输入账号和密码,如果输入后提示无法访问说明smb本身配置没有问题,查看文档的权限和用户的权限,以及用户是否有smb权限。

你可能感兴趣的:(redhat7环境配置,linux基础学习)