Jump to content

SSH hostname completion on Armbian


ElMariachi2021

Recommended Posts

On 2/15/2022 at 2:49 AM, ElMariachi2021 said:

This does not work on Armbian.


Choose ZSH at first login or change in armbian-config. And you will have the same shell.

Link to comment
Share on other sites

Hello!

 

I have switched to zsh, but still I don't get more choice than before:

Zitat

mediaserver:~:# ssh roo�t@             
mediaserver:~:#
mediaserver:~:#
mediaserver:~:# ssh root@mediaserver <TAB>
ip6-localhost  ip6-loopback   localhost      mediaserver 

"mediaserver" is the Armbian system itself.

What I expect is to also have the other hosts in my network availaible, like "router, elite, prtsrv, ..." Like it is on my Manjaro-Notebook:

Zitat

[ladmin@elite~]ssh root@
root@::1                     root@esxi <TAB>
root@192.168.100.1           root@ff02::1
root@192.168.1.1             root@ff02::2
root@192.168.1.20            root@ip6-allnodes
root@192.168.1.22            root@ip6-allrouters
root@192.168.1.24            root@ip6-localhost
root@192.168.1.31            root@ip6-loopback
root@192.168.1.34            root@localhost
root@192.168.1.50            root@opp2e
root@192.168.1.61            root@mediaserver
root@192.168.1.66            root@prtsrv
root@192.168.1.69            root@router
root@192.168.1.70            root@server
root@192.168.1.91            root@truenas

 

I don't know how the names of my other hosts got into that completion list as I did not add them manually. I think they probably have gotten in there automatically by DNS, as they always are available. Een when adding a new host to my LAN it's directly available as an completion option.

 

Thank you for all your help! :)

 

Link to comment
Share on other sites

12 minutes ago, ElMariachi2021 said:

I don't know how the names of my other hosts got into that completion list as I did not add them manually. I think they probably have gotten in there automatically by DNS, as they always are available. Een when adding a new host to my LAN it's directly available as an completion option.


I don't know what is missing. Try to find out and we can add that for the future.

Link to comment
Share on other sites

Hello!

 

I found the reason:

It simply is the default configuration in "/etc/ssh/ssh_config".

There's the line "    HashKnownHosts yes", which probably is supposed to make SSH a little more secure. I don't really see a problem with having the LAN's other hostnames available, and the hashing will prevent SSH hostname completion from working, as the hostnames have to be read from the ssh config files for this to work.

 

So it would be nice, if armbian-config had an option to "Enable SSH remote hostname completion" with a note that this will lead to config files including clear readable hostnames (which in advance will set "    HashKnownHosts no".

Also the existing file ~/.ssh/known_hosts" has to be deleted for SSH to recreate it with non-hashed hostnames.

 

Alternatively this behaviour can be overriden for the current user having a local configuration file "~/.ssh/config" with the contents:

Zitat

Host *
        HashKnownHosts no

And the file permissions: 600

 

:)

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines