Problem z SSH logowanie na niektóre urządzenia

Konfiguracja serwerów, usług, itp.
pawel2006
Posty: 3
Rejestracja: 08 sierpnia 2017, 11:33

Problem z SSH logowanie na niektóre urządzenia

Post autor: pawel2006 »

Witam serdecznie :)

Mam dziwny problem na swoim systemie. Nie mogę się zalogować na niektóre urządzenia w sieci. Sytuacja wygląda tak, że np na ip 172.16.1.95 loguje się bez problemu czy to z kluczem czy też bez a np na 172.16.1.78 już niestety nie mogę. Adres nie jest dodany nigdzie do blokady,ping do urządzenia jest, nawet z innego serwera się mogę zalogować czy to nawet przez putty a z tego konkretnego nie moge.
Gdzie szukać przyczyny ?
Wersja debiana to

Kod: Zaznacz cały

root@jaszczur:~# uname -a
Linux jaszczur 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u2 (2017-06-26) x86_64 GNU/Linux
po odpaleniu ssh na dany adres wygląda to tak :

Kod: Zaznacz cały

root@jaszczur:~# ssh admin@172.16.1.78 -p 60022
^C
root@jaszczur:~# ssh -v admin@172.16.1.78 -p 60022
OpenSSH_6.7p1 Debian-5+deb8u3, OpenSSL 1.0.1t  3 May 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 172.16.1.78 [172.16.1.78] port 60022.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/identity type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/identity-cert type -1
debug1: identity file /root/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type 2
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519-cert type -1

root@jaszczur:~# ssh -v ubnt@172.16.1.111 -p 60022
OpenSSH_6.7p1 Debian-5+deb8u3, OpenSSL 1.0.1t  3 May 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 172.16.1.111 [172.16.1.111] port 60022.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/identity type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/identity-cert type -1
debug1: identity file /root/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type 2
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519-cert type -1

Awatar użytkownika
lizard
Beginner
Posty: 287
Rejestracja: 08 lutego 2016, 18:47

Re: Problem z SSH logowanie na niektóre urządzenia

Post autor: lizard »

Co pokazują polecenia:
Na serwerze:

Kod: Zaznacz cały

grep -vE '^[[:space:]]*(#|$)' /etc/ssh/sshd_config
Na kliencie:

Kod: Zaznacz cały

grep -vE '^[[:space:]]*(#|$)' /etc/ssh/ssh_config
grep -vE '^[[:space:]]*(#|$)' ~/.ssh/config
pawel2006
Posty: 3
Rejestracja: 08 sierpnia 2017, 11:33

Re: Problem z SSH logowanie na niektóre urządzenia

Post autor: pawel2006 »

dziękuję za odpowiedz

oto wynik

Kod: Zaznacz cały

root@jaszczur:~# grep -vE '^[[:space:]]*(#|$)' /etc/ssh/sshd_config
Port 60022
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 1024
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
PermitRootLogin without-password
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes
root@jaszczur:~#

Co do klientów to te polecenia nic nie pokazują. Na mikrotiku nie ma możliwości wpsania w/w polecenia a na ubnt

Kod: Zaznacz cały

XM.v5.5.4# grep -vE '^[[:space:]]*(#|$)' /etc/ssh/ssh_config
grep: /etc/ssh/ssh_config: No such file or directory
XM.v5.5.4# grep -vE '^[[:space:]]*(#|$)' ~/.ssh/config
grep: /etc/persistent/.ssh/config: No such file or directory
XM.v5.5.4#
Awatar użytkownika
lizard
Beginner
Posty: 287
Rejestracja: 08 lutego 2016, 18:47

Re: Problem z SSH logowanie na niektóre urządzenia

Post autor: lizard »

Widzę, że zaszło nieporozumienie. Jak widzę, jaszczur to komputer kliencki i to zawartość jego plików konfiguracyjnych (/etc/ssh/ssh_config i ~/.ssh/config) chciałem zobaczyć. Interesuje mnie także konfiguracja usługi ssh na serwerze, z którym nie możesz się połączyć. Jeśli jest to system uniksowy (Linux, BSD, inny), to pokaż plik /etc/ssh/sshd_config (skorzystaj z podanej przez mnie składni grepa, aby wyciąć komentarze i puste linie), a jeżeli mikrotik lub inny system wbudowany, to spróbuj ją wyeksportować do pliku tekstowego lub pokaż zrzut ekranu.
pawel2006
Posty: 3
Rejestracja: 08 sierpnia 2017, 11:33

Re: Problem z SSH logowanie na niektóre urządzenia

Post autor: pawel2006 »

ok a więc tak :

Kod: Zaznacz cały

root@jaszczur:~# grep -vE '^[[:space:]]*(#|$)' /etc/ssh/ssh_config
Host *
StrictHostKeyChecking no
   Protocol 2,1
    SendEnv LANG LC_*
    HashKnownHosts yes
    GSSAPIAuthentication yes
    GSSAPIDelegateCredentials no
root@jaszczur:~#

Kod: Zaznacz cały

root@jaszczur:~# grep -vE '^[[:space:]]*(#|$)' ~/.ssh/config
grep: /root/.ssh/config: Nie ma takiego pliku ani katalogu
Na serwerze z ubiquiti mam takie coś

Kod: Zaznacz cały

XM.v5.5.4# grep -vE '^[[:space:]]*(#|$)' /etc/ssh/sshd_config
grep: /etc/ssh/sshd_config: No such file or directory
W mikrotiku nie wiem ze bardzo gdzie jest konfiguracja ssh. To raczej usługa która wbudowana, jest możliwość tylko zmiany portu.
Według mnie to coś jest z serwerem jaszczur ponieważ na te urządzenia które on sie nie chce zalogować ja normalnie przez putty czy z innej maszyny bez problemu się loguje
ODPOWIEDZ