Command to see Sharing

bobw

The Late: SuperMacMod
Is there a Unix command to see who is connected over the net using persoanl File Sharing?
 
Best I can find is http://manuals.info.apple.com/en/MacOSXSrvr10.3_CommandLineAdminGuide.pdf

And it seems OSX Server specific. *shrugg*

List of SMB serveradmin Commands
You can use these commands with the serveradmin tool to manage SMB service.

getConnectedUsers List users currently connected to an SMB service.See “Listing SMB Users ” on this page..

Listing SMB Users
You can use the serveradmin getConnectedUsers command to retrieve information
about connected SMB users.For example,you can use this command to retrieve the
session IDs you need to disconnect users.
To list connected users:
$serveradmin command smb:command = getConnectedUsers

Output
The following array of settings is displayed for each connected user:
smb:usersArray:_array_index:i:disconnectID = <disconnectID>
smb:usersArray:_array_index:i:sessionID = <sessionID>
smb:usersArray:_array_index:i:connectAt = <connect-time>
smb:usersArray:_array_index:i:service = <service>
smb:usersArray:_array_index:i:loginElapsedTime = <login-elapsed-time>
smb:usersArray:_array_index:i:name = "<name>"
smb:usersArray:_array_index:i:ipAddress = "<ip-address>"
 
Mac OSX Server has GUI based admin tools that will show who is connected and what protocol they are using.

While the server admin tools are interesting, the original question was about Unix tools and "personal file sharing".

To expand on the original question just a bit, when personal file sharing is turned on, is there ANY easy way (or even not so easy way) to see if anyone is currently connected and, if so, who and what protocol (afp over appletalk, afp over tcp/ip, smb, etc.)

Back in the ancient OS9 days you could just go to the file sharing control panel and look.
 
You can use netstat:
Code:
netstat -n | grep '.548 '
will list all connections on port 548, which is AFP. See
Code:
man netstat
about what the columns mean.
 
Back
Top