首页 文件共享服务教程管理SAMBA用户

SAMBA客户端工具

SAMBA服务器配置

运维派隶属马哥教育旗下专业运维社区,是国内成立最早的IT运维技术社区,欢迎关注公众号:yunweipai
领取学习更多免费Linux云计算、Python、Docker、K8s教程关注公众号:马哥linux运维

管理SAMBA用户

实现samba用户说明
  • 包:samba-common-tools
  • 工具:smbpasswd pdbedit
  • 用户数据库:/var/lib/samba/private/passdb.tdb

说明:samba用户须是Linux用户,建议使用/sbin/nologin

管理用户命令

添加 samba用户:

smbpasswd -a  <user>
pdbedit -a -u <user>

修改用户密码:

smbpasswd  <user>

删除用户和密码:

smbpasswd –x <user> 
pdbedit  –x –u <user>

查看samba用户列表:

pdbedit –L –v

范例:

[root@centos8 ~]#pdbedit  -L
No builtin backend found, trying to load plugin
smb1:1002:
smb2:1003:
smb3:1004:
[root@centos8 ~]#pdbedit  -L -v
No builtin backend found, trying to load plugin
---------------
Unix username:        smb1
NT username:          
Account Flags:        [U          ]
User SID:             S-1-5-21-1476810783-3936299954-1329646792-1000
Primary Group SID:    S-1-5-21-1476810783-3936299954-1329646792-513
Full Name:            
Home Directory:       \\linux39\smb1
HomeDir Drive:        
Logon Script:         
Profile Path:         \\linux39\smb1\profile
Domain:               CENTOS8
Account desc:         
Workstations:         
Munged dial:          
Logon time:           0
Logoff time:          Wed, 06 Feb 2036 23:06:39 CST
Kickoff time:         Wed, 06 Feb 2036 23:06:39 CST
Password last set:    Thu, 19 Dec 2019 10:02:31 CST
Password can change:  Thu, 19 Dec 2019 10:02:31 CST
Password must change: never
Last bad password   : 0
Bad password count  : 0
Logon hours         : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
---------------
Unix username:        smb2
NT username:          
Account Flags:        [U          ]
User SID:             S-1-5-21-1476810783-3936299954-1329646792-1001
Primary Group SID:    S-1-5-21-1476810783-3936299954-1329646792-513
Full Name:            
Home Directory:       \\linux39\smb2
HomeDir Drive:        
Logon Script:         
Profile Path:         \\linux39\smb2\profile
Domain:               CENTOS8
Account desc:         
Workstations:         
Munged dial:          
Logon time:           0
Logoff time:          Wed, 06 Feb 2036 23:06:39 CST
Kickoff time:         Wed, 06 Feb 2036 23:06:39 CST
Password last set:    Thu, 19 Dec 2019 09:57:36 CST
Password can change:  Thu, 19 Dec 2019 09:57:36 CST
Password must change: never
Last bad password   : 0
Bad password count  : 0
Logon hours         : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
---------------

查看samba服务器状态:

smbstatus

范例:

[root@centos8 ~]#smbstatus 

Samba version 4.9.1
PID     Username     Group        Machine                                   Protocol Version  Encryption           Signing              
----------------------------------------------------------------------------------------------------------------------------------------
45299   smb1         smb1         192.168.39.6 (ipv4:192.168.39.6:55898)    NT1               -                    -                    

Service      pid     Machine       Connected at                     Encryption   Signing     
---------------------------------------------------------------------------------------------
smb1         45299   192.168.39.6  Thu Dec 19 10:30:24 AM 2019 CST  -            -           

No locked files

本文链接:https://www.yunweipai.com/36006.html

SAMBA客户端工具

SAMBA服务器配置

网友评论comments

发表回复

您的电子邮箱地址不会被公开。

暂无评论

Copyright © 2012-2022 YUNWEIPAI.COM - 运维派 京ICP备16064699号-6
扫二维码
扫二维码
返回顶部