how to get the user's domain information in samba

ぃ、小莉子 提交于 2019-12-08 01:26:44

问题


BG:I have build samba in redhat linux, and share a folder, then access the share folder from windows.

As the following shows, the connection information can be got via command "smbstatus"

[root@Redhat6 pam.d]# smbstatus

Samba version 3.5.10-125.el6
PID     Username      Group         Machine                        
-------------------------------------------------------------------
8303      leon          domain users  win0832mc    (::ffff:10.204.176.73)

we can get the user, the group of domain, then how to get the domain information? Could please you help me on this? thanks.


回答1:


User name shown by smbstatus is the name of the local user, not the user which connected to the share. The original name might have already been transformed with the help of 'username map' option in smb.conf.

Supposedly, you have one-to-one name mapping between incoming users and local POSIX users. In this case you can use 'wbinfo --uid-to-sid leon' to get Security Identifier (SID) of the user 'leon', and as next step do 'wbinfo --sid-to-fullname sid' to convert SID to fully qualified user name (DOMAIN\user).



来源:https://stackoverflow.com/questions/19398107/how-to-get-the-users-domain-information-in-samba

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!