PDA

View Full Version : How can I ssh in using the host name?



SSteve
2020-08-07, 23:25
I installed 64-bit Kali Linux on my Raspberry Pi in order to follow along with the book Programming with 64-Bit ARM Assembly Language. I've set it up so I can ssh in, but it only works through an IP address ("ssh [email protected]"). How can I ssh in through the host name ("ssh [email protected]")? When I try, I get no response at all.

SSteve
2020-08-23, 00:09
DHCP gave my Kali Pi a new IP address today so I'm revisiting this question. Here's what I've tried today:



installed avahi-daemon https://askubuntu.com/a/23782/445600
made sure /etc/nsswitch.conf contains "hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4"
sudo cp /usr/share/doc/avahi-daemon/examples/ssh.service /etc/avahi/services/ https://askubuntu.com/a/890709/445600
created an empty file called "avahi" in /boot https://forums.kali.org/showthread.php?35722-SOLUTION-Kali-Linux-on-Raspberry-Pi-Zero-W-with-bluetooth-and-wifi-support&p=71226#post71226


I can still ssh in to the IP address but not to kali.local. When I boot the Pi into Raspbian, I can ssh into the Raspbian by host name. I'm trying to ssh in from macOS 10.14.6.

ssh.service contents:


<?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>

What am I missing?