cifs sessions -t [ -c ]
It is also possible to ask for session information by specifying the user's machine_name.
One can always specify the user's client machine_IP_address to the cifs sessions command. However, if the node has not been provided the machine name and session information is asked for using the machine_name argument, the cifs sessions command will fail with the message "User (or PC) not logged in".
The -p option filters sessions based on the version of the SMB protocol used. When the -p option is used with `smb' as the argument, only SMB 1.0 sessions are displayed. When the -p option is used with `smb2' as the argument, only SMB 2.0 sessions are displayed. When the -p option is not used, both SMB 1.0 and SMB 2.0 sessions are displayed. The -p option can be used along with -c and -s options.
The -i option filters the sessions on the basis of the IP protocol used. When -i option is used with `ipv4' as the argument, only sessions established over IPv4 protocol are displayed. When -i option is used with `ipv6' as the argument, only sessions established over IPv6 protocol are displayed. When -i option is not used, all the sessions established over IPv4 and IPv6 are displayed. The -i option can be used along with -c and -s options.
The -t option displays the total count of CIFS sessions, open shares and open files.
The -c option displays information about open directories and the number of active ChangeNotify requests. When used with the -t option, the total count of open directories and active ChangeNotify requests is also shown. When no other option or argument is present, the -c option shows, for each user, the number of open directories and number of active ChangeNotify requests.
A CIFS client connected to the node is displayed under the PC IP (PC Name) column as an IP address followed by a NetBIOS name (if available) within parentheses. If NetBIOS name is unavailable, the name is displayed as an IP address followed by empty parentheses.
cifs sessions Server Registers as 'HAWLEYR-TOKYO' in group 'NT-DOMAIN' Filer is using ja for DOS users WINS Server: 10.10.10.55 Selected domain controller \NT-DOMAIN-BDC for authentication ==================================================== PC IP(PC Name) (user) #shares #files 132.170.108.1(HAWLEY-PC) (hawleyr - root) 1 4 192.123.34.56() (foo - userBar) 2 5
cifs sessions -c Server Registers as 'HAWLEYR-TOKYO' in group 'NT-DOMAIN' Filer is using ja for DOS users WINS Server: 10.10.10.55 Selected domain controller \NT-DOMAIN-BDC for authentication =============================================================================== PC IP (PC Name) (user) #shares #files #dirs #ChangeNotifies 132.170.108.1(HAWLEY-PC) (hawleyr - root) 1 4 1 2 192.123.34.56() (foo - userBar) 5 12 10 10
Executing the command for user sam might produce output as follows:
cifs sessions sam users shares/files opened 172.18.34.11(HAWLEY-HOME1) (sam) ENG-USERS Read-denyW - \SAM\SRC\TEST\test_pgm.c 132.170.108.1(HAWLEY-PC) (sam) ENG-USERS
cifs sessions -c sam users shares/files and directories opened 172.18.34.11(HAWLEY-HOME1) (sam) (using security signatures) ENG-USERS Read-denyW - \SAM\SRC\TEST\test_pgm.c 2 ChgNfys - \SAM\SRC\TEST
Executing the command with -s * might produce the following:
cifs sessions -s * users Security Information WIN-95 (AGuest - nobody[guest]) *************** UNIX uid = 1208 user is a member of group nobody(65535) NT membership NT-DOMAIN\Domain Guests BUILTIN\Guests User is also a member of Everyone, Network Users ***************
Here are examples using the machine_name and
machine_IP_address arguments:
cifs sessions 192.168.228.4 users shares/files opened 10.56.19.93(TORTOLA) (nt-domain\danw - root) HOME cifs sessions tortola users shares/files opened 10.56.19.93(TORTOLA) (nt-domain\danw - root) HOME
Here are examples using the -t option:
cifs sessions -t Using domain authentication. Domain type is Windows 2000. Root volume language is not set. Use vol lang. Number of WINS servers: 0 Total CIFS sessions: 3 CIFS open shares: 3 CIFS open files: 0 CIFS locks: 0 CIFS credentials: 3 CIFS sessions using security signatures: 0 IPv4 CIFS sessions: 1 IPv6 CIFS sessions: 2 Cumulative IPv4 CIFS sessions: 2 Cumulative IPv6 CIFS sessions: 4
Here are examples using the -p option:
cifs sessions -p smb Server Registers as 'F3050-204-45' in Windows 2000 domain 'IPV6' Root volume language is not set. Use vol lang. Selected domain controller \W204-114-PC for authentication ==================================================== PC IP(PC Name) (user) #shares #files fd20:81be:b255:4204:8cc6:c4d:74cf:e58b(VISTA204-111-PC) (ipv6dministrator - root) 1 0 10.73.9.69(foo-lxp) (ipv6dministrator - root) 1 0 cifs sessions -p smb2 Server Registers as 'F3050-204-45' in Windows 2000 domain 'IPV6' Root volume language is not set. Use vol lang. Selected domain controller \W204-114-PC for authentication ==================================================== PC IP(PC Name) (user) #shares #files fd20:81be:b255:4204:4de2:f734:ca3b:b056(W204-116-PC) (ipv6dministrator - root) 1 0
cifs sessions -i ipv4 Server Registers as 'F3050-204-45' in Windows 2000 domain 'IPV6' Root volume language is not set. Use vol lang. Selected domain controller \W204-114-PC for authentication ==================================================== PC IP(PC Name) (user) #shares #files 10.73.9.69(foo-lxp) (ipv6dministrator - root) 1 0 cifs sessions -i ipv6 Server Registers as 'F3050-204-45' in Windows 2000 domain 'IPV6' Root volume language is not set. Use vol lang. Selected domain controller \W204-114-PC for authentication ==================================================== PC IP(PC Name) (user) #shares #files fd20:81be:b255:4204:4de2:f734:ca3b:b056(W204-116-PC) (ipv6dministrator - root) 1 0 fd20:81be:b255:4204:8cc6:c4d:74cf:e58b(VISTA204-111-PC) (ipv6dministrator - root) 1 0