TureNAS Scale 获取用户的SID

为了对特定用户隐藏没有权限的共享目录,找了半天,全都是错的,什么net useridlist根本返回Could not get the user/sid list

准确的办法是如下:

列出所有用户的SID

TureNAS# pdbedit -Lv

如果要列出某个用户的SID就再后面加上用户名

TureNAS# pdbedit -Lv test
lpcfg_do_global_parameter: WARNING: The "syslog only" option is deprecated
Unix username:        test
NT username:
Account Flags:        [U          ]
User SID:             S-1-5-21-5555555555-5555555555-5555555555-20077
Primary Group SID:    S-1-5-21-5555555555-5555555555-5555555555-513
Full Name:            test
Home Directory:       \\TRUENAS\test
HomeDir Drive:
Logon Script:
Profile Path:         \\TRUENAS\test\profile
Domain:               TRUENAS
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:    Mon, 21 Aug 2023 12:40:26 CST
Password can change:  Mon, 21 Aug 2023 12:40:26 CST
Password must change: never
Last bad password   : 0
Bad password count  : 0
Logon hours         : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

参考链接:https://groups.google.com/g/linux.samba/c/UKNX9Xv8dlY