Difference between revisions of "Avahi Notes"

From Noah.org
Jump to navigationJump to search
m
m
Line 3: Line 3:
 
Monitor Zeroconf advertisements:
 
Monitor Zeroconf advertisements:
 
<pre>
 
<pre>
avahi-browse -a --resolve
+
avahi-browse --all --resolve
 
</pre>
 
</pre>
 +
 +
To look for just SSH services use the following command. Note the rather cryptic type name that you must use.
 +
<pre>
 +
avahi-browse _ssh._tcp
 +
</pre>
 +
 +
The '''--dump-db''' option is almost totally useless since it lists the human readable names of the service types, but it does not give you the actual name that you need to use to browse that service. For example, '''--dump-db''' will list '''SSH Remote Terminal''' as one of the service types, but to actually browse for that service you need to use the type name of '''_ssh._tcp''', which is a name I will never remember. You can't use '''--dump-db''' to remind yourself of this.
 +
 +
== GUI browser ==
 +
 +
The '''avahi-discover''' package has a simple GUI browser. This is the equivalent of the command-line tool '''avahi-browse'''.
  
 
== avahi-daemon ==
 
== avahi-daemon ==

Revision as of 19:49, 23 October 2012


Monitor Zeroconf advertisements:

avahi-browse --all --resolve

To look for just SSH services use the following command. Note the rather cryptic type name that you must use.

avahi-browse _ssh._tcp

The --dump-db option is almost totally useless since it lists the human readable names of the service types, but it does not give you the actual name that you need to use to browse that service. For example, --dump-db will list SSH Remote Terminal as one of the service types, but to actually browse for that service you need to use the type name of _ssh._tcp, which is a name I will never remember. You can't use --dump-db to remind yourself of this.

GUI browser

The avahi-discover package has a simple GUI browser. This is the equivalent of the command-line tool avahi-browse.

avahi-daemon

If you want Avahi to publish your SSH service you must create a service config for it. You can usually just copy the example one and use it without editing it.

cp /usr/share/doc/avahi-daemon/examples/ssh.service /etc/avahi/services/.

If that example is not available then the following should work if copied to /etc/avahi/services/ssh.service.

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
  <name replace-wildcards="yes">%h</name>
  <service>
    <type>_ssh._tcp</type>
    <port>22</port>
  </service>
</service-group>