7
j0n4s
7y

I'm trying to install my SSH Server and nothing works. I think i've seen every SSH Stackoverflow site and i'm still too dumb :C

Comments
  • 2
    What kind of a server is it?
  • 1
  • 1
    @Bitwise I have a firewall and no i didn't do anything with ip tables. It says key_load_private: invalid format
  • 1
    When in doubt arch wiki:
    https://wiki.archlinux.org/index.ph...

    Hmm maybe something went wrong with generating keys.

    Could you show us how you generated them?
  • 0
    @rootshell ssh-keygen -t rsa -f path/to/the/keys
  • 0
    @rootshell when i give the path to the private key it works but connecting to the server won't work
  • 1
    @nobes have you checked out the copy-ssh-id command? I'm lazy. 😄
  • 2
    @nobes
    Checklist:
    - ssh daemon is running
    - ip:port is correct
    - username is correct
    - sshd supports rsa
    - rsa file looks okay in text editor
    - rsa key copied in correct file
    - rights set correctly on file
  • 1
    @rootshell Thanks. I'll check that
  • 0
    @Bitwise I connect from localhost and then it says Host key verification failed
  • 0
    @Bitwise now when i run sshd -t to verify that everything is ok it says:
    Could not load host key: /etc/ssh/ssh_host_rsa_key and the ecdsa key and the ed25519 key
  • 0
    @Bitwise No! Can i login with password with the normal ssh command?
  • 0
    @Bitwise but it says it's listening to port 22 and it responds but it can't verify
  • 0
    @bitwise the output from systemctl status sshd:

    sshd.service - OpenSSH Daemon

    Loaded: loaded (/usr/lib/systemd/system/sshd.service; disabled; vendor preset: disab>

    Active: active (running) since Tue 2018-05-29 18:52:02 CEST; 12s ago

    Main PID: 1382 (sshd)

    Tasks: 1 (limit: 4393)

    Memory: 828.0K

    CGroup: /system.slice/sshd.service

    └─1382 /usr/bin/sshd -D

    Mai 29 18:52:02 jonas-server systemd[1]: Started OpenSSH Daemon.

    Mai 29 18:52:02 jonas-server sshd[1382]: Server listening on 0.0.0.0 port 22.

    Mai 29 18:52:02 jonas-server sshd[1382]: Server listening on :: port 22.
  • 0
    [jonas@jonas-server ssh]$ ssh jonas@localhost -p 22

    The authenticity of host 'localhost (::1)' can't be established.

    ECDSA key fingerprint is SHA256:roAn...

    Are you sure you want to continue connecting (yes/no)?

    Host key verification failed.
  • 0
    @Bitwise ssh -o StrictHostKeyChecking=no user@localhost asked me for a password but which password?
  • 0
    @Bitwise That doesn't work :/
  • 0
    @Bitwise thanks now it works! Forgot to change "user@localhost" to "jonas@localhost"
  • 0
    @Bitwise It still says "Host key verification failed."
  • 0
    @bitwise now there is just one line "jonas@localhost: Permission denied (publickey).

    "
  • 0
    @Bitwise thanks i thought the authorized keys is a folder... Now it works with the key! Thank you!!
  • 0
    @bitwise ok thanks
  • 0
    @Bitwise how can i access the ssh server from the local network? Do i need to change something in the iptables or hosts.allow or in the sshd_config?
  • 0
    Everything checked and restarted the server but I can't access from the local network. I also can't telnet the server on port 22
  • 0
    @Bitwise when i check the port with nmap it says that the port is filtered, that means it doesn't get an answer from the ssh server 🤔
  • 0
    @Bitwise With ipv6 too..
  • 0
    @Bitwise Everything fine i was sleeping too. Didn't knew that linux has a firewall which blocks all ports. That was the Problem! Thank you very much!
Add Comment