• ssh, where do the host come from

    From fxkl47BF@protonmail.com@21:1/5 to All on Fri May 16 17:00:01 2025
    when i type ssh and two tabs i get a list of host
    numeric and names
    where do they come from

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Charles Curley@21:1/5 to fxkl47BF@protonmail.com on Fri May 16 17:40:01 2025
    On Fri, 16 May 2025 14:56:41 +0000
    fxkl47BF@protonmail.com wrote:

    when i type ssh and two tabs i get a list of host
    numeric and names
    where do they come from


    If I type 'ssh<tab><tab>' I get proposed tab completions of various
    programs, all starting with ssh.

    If I type 'ssh<space><tab><tab>' I get proposed IP addresses and host
    names as arguments to ssh. The seem to be hosts on my local network,
    hosts I have in ~/.ssh/config>, and some I don't recognize.

    All these are provided by bash tab completion, provided bu the package bash-completion, and you may search on that phrase for more
    information.

    --
    Does anybody read signatures any more?

    https://charlescurley.com
    https://charlescurley.com/blog/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dan Ritter@21:1/5 to fxkl47BF@protonmail.com on Fri May 16 17:40:01 2025
    fxkl47BF@protonmail.com wrote:
    when i type ssh and two tabs i get a list of host
    numeric and names
    where do they come from

    Assuming that your shell is bash, it comes from the bash tab
    completion function, which has an optional package:

    bash-completion/stable,now 1:2.11-6 all
    programmable completion for the bash shell

    and many packages add such completions to that, if available.


    Read up on how it works in `man bash` under the title
    Programmable Completion.

    -dsr-

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Green@21:1/5 to fxkl47BF@protonmail.com on Fri May 16 18:00:01 2025
    fxkl47BF@protonmail.com wrote:
    when i type ssh and two tabs i get a list of host
    numeric and names
    where do they come from

    Assuming you are using bash (or another shell that does TAB
    completion) I think it's probably just a list of file and directory
    names in the current directory.

    Try doing the same in a different directory.

    --
    Chris Green
    ·

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From basti@21:1/5 to fxkl47BF@protonmail.com on Fri May 16 18:00:01 2025
    Hello,
    first of all they come from ~/.ssh/config and there includes, if there.
    Or they come from /etc/hosts.

    Best Regards,
    On 16.05.25 16:56, fxkl47BF@protonmail.com wrote:
    when i type ssh and two tabs i get a list of host
    numeric and names
    where do they come from


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From fxkl47BF@protonmail.com@21:1/5 to Charles Curley on Fri May 16 18:20:01 2025
    On Fri, 16 May 2025, Charles Curley wrote:

    On Fri, 16 May 2025 14:56:41 +0000
    fxkl47BF@protonmail.com wrote:

    when i type ssh and two tabs i get a list of host
    numeric and names
    where do they come from


    If I type 'ssh<tab><tab>' I get proposed tab completions of various
    programs, all starting with ssh.

    If I type 'ssh<space><tab><tab>' I get proposed IP addresses and host
    names as arguments to ssh. The seem to be hosts on my local network,
    hosts I have in ~/.ssh/config>, and some I don't recognize.

    and i also see it looks in ~/.ssh/known_hosts
    i also have several i don't recognize

    as an aside
    in known_hosts there are many key fingerprints with no host identification
    is there a way to identify what host the fingerprint is for

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From tomas@tuxteam.de@21:1/5 to fxkl47BF@protonmail.com on Fri May 16 20:00:01 2025
    On Fri, May 16, 2025 at 04:09:10PM +0000, fxkl47BF@protonmail.com wrote:

    [...]

    as an aside
    in known_hosts there are many key fingerprints with no host identification
    is there a way to identify what host the fingerprint is for

    The file format is described in man 8 sshd.

    Those with "no host identification" most probably just have a hashed host
    name: the idea is that an attacker who gets access to your user account
    doesn't get a neat list of which hosts to try next.

    There is an (sshd, I think) option to change that.

    Cheers
    --
    t

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCaCd8yAAKCRAFyCz1etHa RixsAJ9iHbo+VCQVdr+FB6hjGTMOShk2WQCffXZSVPAc885iWBzCsHyjSOZYQ6k=
    =hyck
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From fxkl47BF@protonmail.com@21:1/5 to tomas@tuxteam.de on Fri May 16 20:40:02 2025
    On Fri, 16 May 2025, tomas@tuxteam.de wrote:

    On Fri, May 16, 2025 at 04:09:10PM +0000, fxkl47BF@protonmail.com wrote:

    [...]

    as an aside
    in known_hosts there are many key fingerprints with no host identification >> is there a way to identify what host the fingerprint is for

    The file format is described in man 8 sshd.

    Those with "no host identification" most probably just have a hashed host name: the idea is that an attacker who gets access to your user account doesn't get a neat list of which hosts to try next.

    There is an (sshd, I think) option to change that.

    i see

    Alternately, hostnames may be stored in a hashed form which hides host names and addresses should the file's contents be disclosed. Hashed hostnames start with a ‘|’ character. Only one hashed hostname may appear on a single line and none of the
    above negation or wildcard operators may be applied.

    i don't see how to change it

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Chris Green on Fri May 16 21:00:01 2025
    On Fri, May 16, 2025 at 16:39:15 +0100, Chris Green wrote:
    fxkl47BF@protonmail.com wrote:
    when i type ssh and two tabs i get a list of host
    numeric and names
    where do they come from

    Assuming you are using bash (or another shell that does TAB
    completion) I think it's probably just a list of file and directory
    names in the current directory.

    Try doing the same in a different directory.

    No, it's almost certainly programmable completion from the bash-completion package. It's installed and used by default in Debian. (Some of us
    disable or remove it. I don't care for it, personally. Too flaky.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From tomas@tuxteam.de@21:1/5 to fxkl47BF@protonmail.com on Fri May 16 21:00:01 2025
    On Fri, May 16, 2025 at 06:32:16PM +0000, fxkl47BF@protonmail.com wrote:
    On Fri, 16 May 2025, tomas@tuxteam.de wrote:

    [...]

    There is an (sshd, I think) option to change that.

    i see

    Alternately, hostnames may be stored in a hashed form which hides host names and addresses should the file's contents be disclosed. Hashed hostnames start with a ‘|’ character. Only one hashed hostname may appear on a single line and none of the
    above negation or wildcard operators may be applied.

    i don't see how to change it

    Ah, no,, sorry. I lied to you, it's in the ssh_config (/etc/ssh/ssh_config). Here's the extract from man ssh_config:

    HashKnownHosts
    Indicates that ssh(1) should hash host names and ad‐
    dresses when they are added to ~/.ssh/known_hosts.
    These hashed names may be used normally by ssh(1) and
    sshd(8), but they do not visually reveal identifying
    information if the file's contents are disclosed.
    The default is no. Note that existing names and ad‐
    dresses in known hosts files will not be converted
    automatically, but may be manually hashed using
    ssh-keygen(1). Use of this option may break facili‐
    ties such as tab-completion that rely on being able
    to read unhashed host names from ~/.ssh/known_hosts.

    ...and the default in Debian is:

    tomas@caliban:~$ grep -i hash /etc/ssh/ssh_config
    HashKnownHosts yes

    ...so there you are :)

    Cheers
    --
    t

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCaCeJIAAKCRAFyCz1etHa RjQTAJ9HalbmatmJ3hJxOQG6w0N0NO9rigCeN4gMdnmFT70zoFai+19sxrbOMT4=
    =TCMV
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From fxkl47BF@protonmail.com@21:1/5 to tomas@tuxteam.de on Fri May 16 23:10:01 2025
    On Fri, 16 May 2025, tomas@tuxteam.de wrote:

    On Fri, May 16, 2025 at 06:32:16PM +0000, fxkl47BF@protonmail.com wrote:
    On Fri, 16 May 2025, tomas@tuxteam.de wrote:

    [...]

    There is an (sshd, I think) option to change that.

    i see

    Alternately, hostnames may be stored in a hashed form which hides host names and addresses should the file's contents be disclosed. Hashed hostnames start with a ‘|’ character. Only one hashed hostname may appear on a single line and none of the
    above negation or wildcard operators may be applied.

    i don't see how to change it

    Ah, no,, sorry. I lied to you, it's in the ssh_config (/etc/ssh/ssh_config). Here's the extract from man ssh_config:

    HashKnownHosts
    Indicates that ssh(1) should hash host names and ad‐
    dresses when they are added to ~/.ssh/known_hosts.
    These hashed names may be used normally by ssh(1) and
    sshd(8), but they do not visually reveal identifying
    information if the file's contents are disclosed.
    The default is no. Note that existing names and ad‐
    dresses in known hosts files will not be converted
    automatically, but may be manually hashed using
    ssh-keygen(1). Use of this option may break facili‐
    ties such as tab-completion that rely on being able
    to read unhashed host names from ~/.ssh/known_hosts.

    ...and the default in Debian is:

    tomas@caliban:~$ grep -i hash /etc/ssh/ssh_config
    HashKnownHosts yes

    ...so there you are :)


    thanks
    i understand the no host hash in an industrial setting
    but in a home network it seems unnecessary

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From tomas@tuxteam.de@21:1/5 to fxkl47BF@protonmail.com on Sat May 17 06:50:01 2025
    On Fri, May 16, 2025 at 09:02:03PM +0000, fxkl47BF@protonmail.com wrote:
    On Fri, 16 May 2025, tomas@tuxteam.de wrote:

    [...]

    thanks

    You are welcome :-)

    i understand the no host hash in an industrial setting
    but in a home network it seems unnecessary

    Well -- there are mixed cases. In my case, my laptop is
    my laptop. I use it to log in into many a customer's box
    and fix things.

    Of course, the harddisk is encrypted, but if someone finds
    an exploit while my box is running, I'd like them to find
    as little help as possible to hack my customers.

    If you watch how exploits usually go, you'll see that many
    move from one weakness to the next, until reaching their goal.

    That's why the concept of "defense in depth" [1] makes sense
    in our context.

    Cheers

    [1] https://en.wikipedia.org/wiki/Defense_in_depth_(computing)
    --
    tomás

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCaCgTKQAKCRAFyCz1etHa RjLJAJwPy7+/C4RsQV0NcPZEUkIER6OWGACeOCC4N8wa03tt0eeWxSHc2qx7LEo=
    =eyrf
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Henrik Ahlgren@21:1/5 to fxkl47BF@protonmail.com on Sat May 17 15:40:01 2025
    fxkl47BF@protonmail.com writes:

    and i also see it looks in ~/.ssh/known_hosts
    i also have several i don't recognize

    You are probably wondering about the default IPv6 entries in /etc/hosts

    ::1 localhost ip6-localhost ip6-loopback
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters

    Of course, it is somewhat dumb that those are included in the
    completion, as you cannot SSH to those link-local multicast addresses,
    and it is quite rare to SSH into localhost.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Henrik Ahlgren on Sat May 17 16:00:01 2025
    On Sat, May 17, 2025 at 16:37:07 +0300, Henrik Ahlgren wrote:
    and it is quite rare to SSH into localhost.

    It's not something I do on a daily basis, but I've done it several
    times, because it's an excellent way to test various things, such as
    changes to your dot files, sshd configuration, PAM configuration, and
    so on.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Wright@21:1/5 to Greg Wooledge on Sun May 18 06:10:01 2025
    On Fri 16 May 2025 at 14:57:15 (-0400), Greg Wooledge wrote:
    On Fri, May 16, 2025 at 16:39:15 +0100, Chris Green wrote:
    fxkl47BF@protonmail.com wrote:
    when i type ssh and two tabs i get a list of host
    numeric and names
    where do they come from

    Assuming you are using bash (or another shell that does TAB
    completion) I think it's probably just a list of file and directory
    names in the current directory.

    Try doing the same in a different directory.

    No, it's almost certainly programmable completion from the bash-completion package.

    Yes, it is bash-completion. It's a minor inconvenience when you have
    a very large number of hosts defined:

    $ ssh
    Display all 13590 possibilities? (y or n)

    and use ssh or scp for file transfer on the LAN.

    It's installed and used by default in Debian.

    It may be installed, but I've always had to use:

    [ -f /etc/bash_completion ] && . /etc/bash_completion # Use bash-completion if available

    in order for it to work:

    $ grep -A8 'bash completion' /etc/bash.bashrc
    # enable bash completion in interactive shells
    #if ! shopt -oq posix; then
    # if [ -f /usr/share/bash-completion/bash_completion ]; then
    # . /usr/share/bash-completion/bash_completion
    # elif [ -f /etc/bash_completion ]; then
    # . /etc/bash_completion
    # fi
    #fi

    $

    Cheers,
    David.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to David Wright on Sun May 18 15:30:01 2025
    On Sat, May 17, 2025 at 23:09:18 -0500, David Wright wrote:
    It may be installed, but I've always had to use:

    [ -f /etc/bash_completion ] && . /etc/bash_completion # Use bash-completion if available

    in order for it to work:

    $ grep -A8 'bash completion' /etc/bash.bashrc
    # enable bash completion in interactive shells
    #if ! shopt -oq posix; then
    # if [ -f /usr/share/bash-completion/bash_completion ]; then
    # . /usr/share/bash-completion/bash_completion
    # elif [ -f /etc/bash_completion ]; then
    # . /etc/bash_completion
    # fi
    #fi

    $

    Take a look at /etc/skel/.bashrc as well. You and I are not using
    the Debian default .bashrc file, obviously.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From COMCAST@21:1/5 to All on Sun May 18 16:10:02 2025
    What file does in Linux use to the store network address in?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From tomas@tuxteam.de@21:1/5 to COMCAST on Sun May 18 16:20:01 2025
    On Sun, May 18, 2025 at 09:42:45AM -0400, COMCAST wrote:
    What file does in Linux use to the store network address in?

    Whose network address? And: what do you mean by "store"?

    Could you please explain what you are trying to do?

    Cheers
    --
    t

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCaCnrggAKCRAFyCz1etHa Rt4oAJ975f5ug22fhybT9shplzh+7nvo6QCfQr0MGfPCQAClJIBBtPzSZYSce/o=
    =7qTt
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Felix Miata@21:1/5 to All on Sun May 18 17:20:01 2025
    COMCAST composed on 2025-05-18 09:42 (UTC-0400):

    What file does in Linux use to the store network address in?

    That depends on context. e.g. local ethernet port may be configured via ifupdown,
    or Network Manager, or systemd-network, and you may be using DHCP to determine its
    IP, or set it up statically. What context does your question apply to?
    --
    Evolution as taught in public schools is, like religion,
    based on faith, not based on science.

    Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

    Felix Miata

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Nicholas Geovanis on Sun May 18 18:10:02 2025
    On Sun, May 18, 2025 at 10:35:37 -0500, Nicholas Geovanis wrote:
    If you mean "what file contains the IP address and hostname of my own server?": It depends whether you use NetworkManager to configure networking or the older style.

    In the older style the config file goes in /etc/sysconfig/network-scripts
    and contains the NIC name as part of the filename. With NetworkManager the file has a different format and name and goes in /etc/NetworkManager/connection-scripts.
    There are command-line tools to configure NetworkManager-style like nmtui
    and nmcli if you reject GUIs ;-) You may need to install one of them if not already.

    You're thinking of Red Hat, perhaps. Or some other non-Debian distribution.

    Debian doesn't use /etc/sysconfig/. The standard method of configuring interfaces in Debian uses the ifupdown package, and its configuration
    files are in /etc/network/. Specifically, see "man 5 interfaces" for
    details of the /etc/network/interfaces file, or files placed in the /etc/network/interfaces.d/ subdirectory.

    Debian also offers Network Manager, which presumably works the same as it
    does in your other distributions.

    Debian also offers systemd-networkd(8) as a third option.

    Any given Debian system may use any one of these means of configuring
    network interfaces. A system may also use a combination of them; for
    example, it's not uncommon to configure the loopback interface in /etc/network/interfaces, but to configure the wireless interface in NM.
    Or, one may use systemd.link(5) files to configure the names of the
    interfaces, and then use /etc/network/interfaces to configure their IP addresses.

    Lots of options are available, to suit the needs of Debian's extremely
    wide and diverse user base.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)