Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list AFP shares from command-line (MacOS)?

From the command-line, I need to list all the AFP shares available from a given server on a local network.

I can browse the available servers that provides AFP as follow:

iMac:bin me$ dns-sd -B _afpovertcp._tcp
Browsing for _afpovertcp._tcp
Timestamp     A/R Flags if Domain                    Service Type              Instance Name
10:36:36.531  Add     3  4 local.                    _afpovertcp._tcp.         iMac
10:36:36.547  Add     3  5 local.                    _afpovertcp._tcp.         iMac
10:36:36.547  Add     3  4 local.                    _afpovertcp._tcp.         box
10:36:36.547  Add     2  5 local.                    _afpovertcp._tcp.         box
^C

And now I want to know what shares are available from "iMac" for instance (the ones that are displayed by the Finder when you clic on the server icon in the "Shares" left-column view) ?

PS I already found many threads about this (here and here), but they are unanswered for this specific topic.

like image 941
Christophe Avatar asked Oct 09 '12 08:10

Christophe


People also ask

What command line does macOS use?

The Mac command line is a program called Terminal. It lives in the /Applications/Utilities/ folder. To find it, go to your Applications folder.

How do I mount a network drive in Mac Terminal?

In Finder, either hit Command+K to bring up “Connect to Server” or click Go > Connect to Server. Enter the path of the network drive you're trying to map (e.g. smb://192.168.1.300/shared/Files) and click Connect. Enter your login details and password then click OK to mount the network drive.


1 Answers

Have alook at this one:

https://nmap.org/nsedoc/scripts/afp-showmount.html

I could get the info about available afp-shares with nmap...

My command:

nmap -p 548 --script afp-showmount --script-args afp.username=yourusername,afp.password=yourpassword yourserveraddress

like image 112
Jan Fröhling Avatar answered Oct 02 '22 10:10

Jan Fröhling