管理SAMBA用户

管理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

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

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/52516.html

(0)
上一篇 2021年8月6日
下一篇 2021年8月6日

相关推荐

发表回复

登录后才能评论