• Noxy@pawb.social
    link
    fedilink
    English
    arrow-up
    0
    ·
    9 months ago

    ssh connects and logs into the specified destination, which may be specified as either [user@]hostname or a URI of the form ssh://[user@]hostname[:port]

    ssh [admin@]192.168.1.1
    ssh: Could not resolve hostname ]192.168.1.1: No address associated with hostname
    

    That’s how I would interpret that part of the man page had I no familiarity with ssh. It doesn’t seem reasonable to expect the reader to know what those brackets mean.

    • AnUnusualRelic@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      9 months ago

      You get to learn the notation conventions with <> and [] fairly early on. Maybe a very new user would make that mistake. If he doesn’t get it fairly quick, maybe computers aren’t for him.

      • Noxy@pawb.social
        link
        fedilink
        English
        arrow-up
        0
        ·
        9 months ago

        BS. I’ve been using linux for over 20 years and I still don’t know what those mean. I can only guess from context. It’s a stupid convention to just use symbols like that and never explain it.

    • Postimo@lemmy.zip
      link
      fedilink
      arrow-up
      0
      ·
      9 months ago

      Agreed, and I think a larger part of it is that most folks pick it up based on context after long enough, so it’s rarely explained. The square brackets are optional arguments. So I could use ssh 192.168.1.1 or ssh postimo@192.168.1.1 with the first asking for the account after I connect, and the second just asking for the password. You can see how the computer took it in the response you got. hostname ]192.168.1.1 being it saw the @ and assumed everything after was the hostname and included the ]

      It’s worth noting that you can’t just connect to a random machine like this, they need to also be running an ssh server. But I wouldn’t expect you to know that without reading a great deal more of the documentation 🫠