не подключается ssh

Как правильно задавать вопросы Правильно сформулированный вопрос и его грамотное оформление способствует высокой вероятности получения достаточно содержательного и по существу ответа. Общая рекомендация по составлению тем: 1. Для начала воспользуйтесь поиском форума. 2. Укажите версию ОС вместе с разрядностью. Пример: LM 19.3 x64, LM Sarah x32 3. DE. Если вопрос касается двух, то через запятую. (xfce, KDE, cinnamon, mate) 4. Какое железо. (достаточно вывод inxi -Fxz в спойлере (как пользоваться спойлером смотрим здесь)) или же дать ссылку на hw-probe 5. Суть. Желательно с выводом консоли, логами. 6. Скрин. Просьба указывать 2, 3 и 4 независимо от того, имеет ли это отношение к вопросу или нет. Так же не забываем об общих правилах Как пример вот
Закрыто
no avatar

Автор темы
ilbor
Сообщения: 34
Зарегистрирован: 08 июн 2021, 18:07
Решено: 2
Откуда: Санкт-Петербург
Благодарил (а): 6 раз
Контактная информация:

не подключается ssh

#1

23 сен 2021, 15:31

Уважаемые форумчане,

образовалась задача - поставить дома рабочий комп, чтобы к нему можно было подключиться через ssh откуда угодно.
Установил по инструкции ssh-server, настройки самые базовые (даже порт не менял). Подключиться по ssh в терминале не могу, хотя через клиент (putty, например) подключается нормально.

железо:
(base) ilbor@ilbor:~$ inxi -Fxz
System: Kernel: 5.10.30-051030-generic x86_64 bits: 64 compiler: N/A Desktop: Cinnamon 4.8.6 Distro: Linux Mint 20.1 Ulyssa
base: Ubuntu 20.04 focal
Machine: Type: Desktop Mobo: Micro-Star model: MAG B550 TOMAHAWK (MS-7C91) v: 2.0 serial: <filter>
UEFI: American Megatrends LLC. v: A.60 date: 05/12/2021
CPU: Topology: 12-Core model: AMD Ryzen 9 3900X bits: 64 type: MT MCP arch: Zen L2 cache: 6144 KiB
flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 182397
Speed: 2058 MHz min/max: 2200/3800 MHz Core speeds (MHz): 1: 2055 2: 3602 3: 2200 4: 2201 5: 2057 6: 3593 7: 2050
8: 2193 9: 2195 10: 2199 11: 2200 12: 2195 13: 2053 14: 2191 15: 2195 16: 2202 17: 2192 18: 2199 19: 2198 20: 2196
21: 2198 22: 2200 23: 2199 24: 2192
Graphics: Device-1: NVIDIA GK208B [GeForce GT 710] vendor: Gigabyte driver: nvidia v: 470.63.01 bus ID: 2b:00.0
Display: x11 server: X.Org 1.20.9 driver: nvidia unloaded: fbdev,modesetting,nouveau,vesa resolution: 1360x768~60Hz
OpenGL: renderer: NVIDIA GeForce GT 710/PCIe/SSE2 v: 4.6.0 NVIDIA 470.63.01 direct render: Yes
Audio: Device-1: NVIDIA GK208 HDMI/DP Audio vendor: Gigabyte driver: snd_hda_intel v: kernel bus ID: 2b:00.1
Device-2: Advanced Micro Devices [AMD] Starship/Matisse HD Audio vendor: Micro-Star MSI driver: snd_hda_intel
v: kernel bus ID: 2d:00.4
Sound Server: ALSA v: k5.10.30-051030-generic
Network: Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Micro-Star MSI driver: r8169 v: kernel
port: e000 bus ID: 05:00.0
IF: enp5s0 state: up speed: 100 Mbps duplex: full mac: <filter>
Device-2: Realtek RTL8125 2.5GbE vendor: Micro-Star MSI driver: r8169 v: kernel port: d000 bus ID: 2a:00.0
IF: enp42s0 state: down mac: <filter>
Drives: Local Storage: total: 4.09 TiB used: 1.49 TiB (36.4%)
ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 970 EVO Plus 500GB size: 465.76 GiB
ID-2: /dev/nvme1n1 vendor: Samsung model: SSD 970 EVO Plus 500GB size: 465.76 GiB
ID-3: /dev/sda vendor: Western Digital model: WD20PURZ-85AKKY0 size: 1.82 TiB
ID-4: /dev/sdb vendor: Western Digital model: WD20EZAZ-22L9GB0 size: 1.82 TiB
Partition: ID-1: / size: 456.96 GiB used: 30.46 GiB (6.7%) fs: ext4 dev: /dev/nvme0n1p2
Sensors: System Temperatures: cpu: 32.4 C mobo: N/A gpu: nvidia temp: 37 C
Fan Speeds (RPM): N/A gpu: nvidia fan: 33%
Info: Processes: 403 Uptime: 25m Memory: 125.79 GiB used: 1.69 GiB (1.3%) Init: systemd runlevel: 5 Compilers: gcc: 9.3.0
Shell: bash v: 5.0.17 inxi: 3.0.38
как ставил:
(base) ilbor@ilbor:~$ sudo apt install openssh-server ssh
(base) ilbor@ilbor:~$ sudo systemctl start sshd
(base) ilbor@ilbor:~$ sudo ufw allow ssh
Правила обновлены
Правила обновлены (v6)

обнаружил ip:
(base) ilbor@ilbor:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 2c:f0:5d:a8:fa:ed brd ff:ff:ff:ff:ff:ff
inet 192.168.1.105/24 brd 192.168.1.255 scope global dynamic noprefixroute enp5s0
valid_lft 86170sec preferred_lft 86170sec
inet6 fe80::c16b:a523:608:6e3d/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: enp42s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether 2c:f0:5d:a8:fa:ec brd ff:ff:ff:ff:ff:ff
проверил порты, 22ой слушается:
(base) ilbor@ilbor:~$ sudo netstat -tulpn
Активные соединения с интернетом (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:5939 0.0.0.0:* LISTEN 1270/teamviewerd
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 824/systemd-resolve
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 3790/sshd: /usr/sbi
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 887/cupsd
tcp6 0 0 :::22 :::* LISTEN 3790/sshd: /usr/sbi
tcp6 0 0 ::1:631 :::* LISTEN 887/cupsd
udp 0 0 0.0.0.0:43373 0.0.0.0:* 885/avahi-daemon: r
udp 0 0 127.0.0.53:53 0.0.0.0:* 824/systemd-resolve
udp 0 0 0.0.0.0:631 0.0.0.0:* 990/cups-browsed
udp 0 0 0.0.0.0:5353 0.0.0.0:* 885/avahi-daemon: r
udp6 0 0 :::36779 :::* 885/avahi-daemon: r
udp6 0 0 :::5353 :::* 885/avahi-daemon: r
к локальному хосту подключается нормально:
(base) ilbor@ilbor:~$ ssh ilbor@localhost -vv
OpenSSH_8.2p1 Ubuntu-4ubuntu0.3, OpenSSL 1.1.1f 31 Mar 2020
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug2: resolving "localhost" port 22
debug2: ssh_connect_direct
debug1: Connecting to localhost [127.0.0.1] port 22.
debug1: Connection established.
debug1: identity file /home/ilbor/.ssh/id_rsa type -1
debug1: identity file /home/ilbor/.ssh/id_rsa-cert type -1
debug1: identity file /home/ilbor/.ssh/id_dsa type -1
debug1: identity file /home/ilbor/.ssh/id_dsa-cert type -1
debug1: identity file /home/ilbor/.ssh/id_ecdsa type -1
debug1: identity file /home/ilbor/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/ilbor/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/ilbor/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/ilbor/.ssh/id_ed25519 type -1
debug1: identity file /home/ilbor/.ssh/id_ed25519-cert type -1
debug1: identity file /home/ilbor/.ssh/id_ed25519_sk type -1
debug1: identity file /home/ilbor/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/ilbor/.ssh/id_xmss type -1
debug1: identity file /home/ilbor/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.3
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.2p1 Ubuntu-4ubuntu0.3
debug1: match: OpenSSH_8.2p1 Ubuntu-4ubuntu0.3 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to localhost:22 as 'ilbor'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-c
debug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com,ssh-ed25519,sk-ssh-ed25519@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@openssh.com,zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256
debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com
debug2: compression stoc: none,zlib@openssh.com
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:ySqnoYrDpX9rIbcxGL9YlxURQWTvk+lH7W2I+NlFttQ
The authenticity of host 'localhost (127.0.0.1)' can't be established.
ECDSA key fingerprint is SHA256:ySqnoYrDpX9rIbcxGL9YlxURQWTvk+lH7W2I+NlFttQ.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
debug2: set_newkeys: mode 1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /home/ilbor/.ssh/id_rsa
debug1: Will attempt key: /home/ilbor/.ssh/id_dsa
debug1: Will attempt key: /home/ilbor/.ssh/id_ecdsa
debug1: Will attempt key: /home/ilbor/.ssh/id_ecdsa_sk
debug1: Will attempt key: /home/ilbor/.ssh/id_ed25519
debug1: Will attempt key: /home/ilbor/.ssh/id_ed25519_sk
debug1: Will attempt key: /home/ilbor/.ssh/id_xmss
debug2: pubkey_prepare: done
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,sk-ssh-ed25519@openssh.com,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com>
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/ilbor/.ssh/id_rsa
debug1: Trying private key: /home/ilbor/.ssh/id_dsa
debug1: Trying private key: /home/ilbor/.ssh/id_ecdsa
debug1: Trying private key: /home/ilbor/.ssh/id_ecdsa_sk
debug1: Trying private key: /home/ilbor/.ssh/id_ed25519
debug1: Trying private key: /home/ilbor/.ssh/id_ed25519_sk
debug1: Trying private key: /home/ilbor/.ssh/id_xmss
debug2: we did not send a packet, disable method
debug1: Next authentication method: password
ilbor@localhost's password:
debug2: we sent a password packet, wait for reply
debug1: Authentication succeeded (password).
Authenticated to localhost ([127.0.0.1]:22).
debug1: channel 0: new [client-session]
debug2: channel 0: send open
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug2: channel_input_open_confirmation: channel 0: callback start
debug2: fd 3 setting TCP_NODELAY
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug1: Sending environment.
debug1: Sending env LANG = ru_RU.UTF-8
debug2: channel 0: request env confirm 0
debug2: channel 0: request shell confirm 1
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel_input_status_confirm: type 99 id 0
debug2: PTY allocation request accepted on channel 0
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0
Last login: Thu Sep 23 12:20:45 2021 from 127.0.0.1


(base) ilbor@ilbor:~$ exit
выход
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
debug2: channel 0: obuf empty
debug2: channel 0: chan_shutdown_write (i0 o1 sock -1 wfd 5 efd 6 [write])
debug2: channel 0: output drain -> closed
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug2: channel 0: rcvd eow
debug2: channel 0: chan_shutdown_read (i0 o3 sock -1 wfd 4 efd 6 [write])
debug2: channel 0: input open -> closed
debug2: channel 0: rcvd close
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
Connection to localhost closed.
Transferred: sent 2604, received 3920 bytes, in 47.4 seconds
Bytes per second: sent 54.9, received 82.7
debug1: Exit status 0
а теперь пытаюсь с другого компа подключиться:
(base) ilya@ilya-MacBookAir:~$ ssh ilbor@192.168.1.105 -vv -p 22
OpenSSH_8.2p1 Ubuntu-4ubuntu0.3, OpenSSL 1.1.1f 31 Mar 2020
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Reading configuration data /etc/ssh/ssh_config.d/ilbor.conf
debug1: /etc/ssh/ssh_config.d/ilbor.conf line 1: Applying options for *
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug2: resolve_canonicalize: hostname 172.27.237.246 is address
debug2: ssh_connect_direct
debug1: Connecting to 172.27.237.246 [172.27.237.246] port 22.
debug1: connect to address 172.27.237.246 port 22: Connection timed out
ssh: connect to host 172.27.237.246 port 22: Connection timed out
притом с putty вообще никаких проблем - вот лог:
Present=1
HostName=192.168.1.105
LogFileName=putty.log
LogType=0
LogFileClash=-1
LogFlush=1
LogHeader=1
SSHLogOmitPasswords=1
SSHLogOmitData=0
Protocol=ssh
PortNumber=22
CloseOnExit=2
WarnOnClose=1
PingInterval=0
PingIntervalSecs=0
TCPNoDelay=1
TCPKeepalives=0
TerminalType=xterm
TerminalSpeed=38400,38400
TerminalModes=CS7=A,CS8=A,DISCARD=A,DSUSP=A,ECHO=A,ECHOCTL=A,ECHOE=A,ECHOK=A,ECHOKE=A,ECHONL=A,EOF=A,EOL=A,EOL2=A,ERASE=A,FLUSH=A,ICANON=A,ICRNL=A,IEXTEN=A,IGNCR=A,IGNPAR=A,IMAXBEL=A,INLCR=A,INPCK=A,INTR=A,ISIG=A,ISTRIP=A,IUCLC=A,IUTF8=A,IXANY=A,IXOFF=A,IXON=A,KILL=A,LNEXT=A,NOFLSH=A,OCRNL=A,OLCUC=A,ONLCR=A,ONLRET=A,ONOCR=A,OPOST=A,PARENB=A,PARMRK=A,PARODD=A,PENDIN=A,QUIT=A,REPRINT=A,START=A,STATUS=A,STOP=A,SUSP=A,SWTCH=A,TOSTOP=A,WERASE=A,XCASE=A
AddressFamily=0
ProxyExcludeList=
ProxyDNS=1
ProxyLocalhost=0
ProxyMethod=0
ProxyHost=proxy
ProxyPort=80
ProxyUsername=
ProxyPassword=
ProxyTelnetCommand=connect %host %port\n
ProxyLogToTerm=1
Environment=
UserName=
UserNameFromEnvironment=0
LocalUserName=
NoPTY=0
Compression=0
TryAgent=1
AgentFwd=0
GssapiFwd=0
ChangeUsername=0
Cipher=aes,chacha20,3des,WARN,des,blowfish,arcfour
KEX=ecdh,dh-gex-sha1,dh-group14-sha1,rsa,WARN,dh-group1-sha1
HostKey=ed25519,ecdsa,rsa,dsa,WARN
RekeyTime=60
GssapiRekey=2
RekeyBytes=1G
SshNoAuth=0
SshBanner=1
AuthTIS=0
AuthKI=1
AuthGSSAPI=1
AuthGSSAPIKEX=1
GSSLibs=libgssapi,libgssapi_krb5,libgss,custom
GSSCustom=
SshNoShell=0
SshProt=3
LogHost=
SSH2DES=0
PublicKeyFile=
RemoteCommand=
RFCEnviron=0
PassiveTelnet=0
BackspaceIsDelete=1
RXVTHomeEnd=0
LinuxFunctionKeys=0
NoApplicationKeys=0
NoApplicationCursors=0
NoMouseReporting=0
NoRemoteResize=0
NoAltScreen=0
NoRemoteWinTitle=0
NoRemoteClearScroll=0
RemoteQTitleAction=1
NoDBackspace=0
NoRemoteCharset=0
ApplicationCursorKeys=0
ApplicationKeypad=0
NetHackKeypad=0
AltF4=1
AltSpace=0
AltOnly=0
ComposeKey=0
CtrlAltKeys=1
TelnetKey=0
TelnetRet=1
LocalEcho=2
LocalEdit=2
Answerback=PuTTY
AlwaysOnTop=0
FullScreenOnAltEnter=0
HideMousePtr=0
SunkenEdge=0
WindowBorder=1
CurType=0
BlinkCur=0
Beep=1
BeepInd=0
BellWaveFile=
BellOverload=1
BellOverloadN=5
BellOverloadT=2000000
BellOverloadS=5000000
ScrollbackLines=2000
DECOriginMode=0
AutoWrapMode=1
LFImpliesCR=0
CRImpliesLF=0
DisableArabicShaping=0
DisableBidi=0
WinNameAlways=0
WinTitle=
TermWidth=80
TermHeight=24
FontName=server:fixed
FontQuality=0
FontVTMode=4
UseSystemColours=0
TryPalette=0
ANSIColour=1
Xterm256Colour=1
TrueColour=1
BoldAsColour=1
Colour0=187,187,187
Colour1=255,255,255
Colour2=0,0,0
Colour3=85,85,85
Colour4=0,0,0
Colour5=0,255,0
Colour6=0,0,0
Colour7=85,85,85
Colour8=187,0,0
Colour9=255,85,85
Colour10=0,187,0
Colour11=85,255,85
Colour12=187,187,0
Colour13=255,255,85
Colour14=0,0,187
Colour15=85,85,255
Colour16=187,0,187
Colour17=255,85,255
Colour18=0,187,187
Colour19=85,255,255
Colour20=187,187,187
Colour21=255,255,255
RawCNP=0
UTF8linedraw=0
PasteRTF=0
MouseIsXterm=0
RectSelect=0
PasteControls=0
MouseOverride=1
Wordness0=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Wordness32=0,1,2,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1
Wordness64=1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,2
Wordness96=1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1
Wordness128=1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Wordness160=1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Wordness192=2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2
Wordness224=2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2
MouseAutocopy=0
MousePaste=implicit
CtrlShiftIns=implicit
CtrlShiftCV=none
LineCodePage=UTF-8
CJKAmbigWide=0
UTF8Override=1
Printer=
CapsLockCyr=0
ScrollBar=1
ScrollBarFullScreen=0
ScrollOnKey=0
ScrollOnDisp=1
EraseToScrollback=1
LockSize=0
BCE=1
BlinkText=0
X11Forward=0
X11Display=
X11AuthType=1
X11AuthFile=
LocalPortAcceptAll=0
RemotePortAcceptAll=0
PortForwardings=
BugIgnore1=0
BugPlainPW1=0
BugRSA1=0
BugIgnore2=0
BugHMAC2=0
BugDeriveKey2=0
BugRSAPad2=0
BugPKSessID2=0
BugRekey2=0
BugMaxPkt2=0
BugOldGex2=0
BugWinadj=0
BugChanReq=0
StampUtmp=1
LoginShell=1
ScrollbarOnLeft=0
BoldFontName=
WideFontName=
WideBoldFontName=
ShadowBold=0
ShadowBoldOffset=1
SerialLine=/dev/ttyS0
SerialSpeed=9600
SerialDataBits=8
SerialStopHalfbits=2
SerialParity=0
SerialFlowControl=1
WindowClass=
ConnectionSharing=0
ConnectionSharingUpstream=1
ConnectionSharingDownstream=1
SSHManualHostKeys=
буду признателен, если поможете настроить без клиента, но и с ним не пропадем :smile:
Комп воткнут в роутер, если это важно; переадресация портов не настроена.

Решение slant » 23 сен 2021, 21:53
ilbor писал(а):
23 сен 2021, 15:31
а теперь пытаюсь с другого компа подключиться:
Скрытый текст
(base) ilya@ilya-MacBookAir:~$ ssh ilbor@192.168.1.105 -vv -p 22
OpenSSH_8.2p1 Ubuntu-4ubuntu0.3, OpenSSL 1.1.1f 31 Mar 2020
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Reading configuration data /etc/ssh/ssh_config.d/ilbor.conf
debug1: /etc/ssh/ssh_config.d/ilbor.conf line 1: Applying options for *
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug2: resolve_canonicalize: hostname 172.27.237.246 is address
debug2: ssh_connect_direct
debug1: Connecting to 172.27.237.246 [172.27.237.246] port 22.
debug1: connect to address 172.27.237.246 port 22: Connection timed out
ssh: connect to host 172.27.237.246 port 22: Connection timed out
У вас проблема в том, что макбук при попытке подключении клиента ssh лезет на совершенно другой адрес. Вместо вашего сервера на 192.168.1.105 почему-то его несет на 172.27.237.246. Почему - сказать не могу, современных маков у меня под рукой нет, так что...
Возможно у вас что-то нахимичено в /etc/ssh/ssh_config или /etc/ssh/ssh_config.d/ilbor.conf (на маке)
Хотя в 99 процентах случаев, в линуксах в эти конфиги вообще не нужно лазить если это лишь клиент ssh на машине.
И инструкцию которую вы использовали имело смысл привести здесь - может она и виновата.

Перейти к ответу ➙

Аватара пользователя

WWolf
Сообщения: 3874
Зарегистрирован: 14 фев 2018, 00:51
Решено: 28
Откуда: Краснодар
Благодарил (а): 1682 раза
Поблагодарили: 1206 раз
Контактная информация:

не подключается ssh

#2

23 сен 2021, 15:37

ilbor писал(а):
23 сен 2021, 15:31
debug2: resolve_canonicalize: hostname 172.27.237.246 is address
debug2: ssh_connect_direct
debug1: Connecting to 172.27.237.246 [172.27.237.246] port 22.
debug1: connect to address 172.27.237.246 port 22: Connection timed out
что-то с хостами намутил

они точно в одной подсети то находятся? на маке какой ip?

no avatar

Автор темы
ilbor
Сообщения: 34
Зарегистрирован: 08 июн 2021, 18:07
Решено: 2
Откуда: Санкт-Петербург
Благодарил (а): 6 раз
Контактная информация:

не подключается ssh

#3

23 сен 2021, 16:06

WWolf писал(а):
23 сен 2021, 15:37
они точно в одной подсети то находятся? на маке какой ip?
Извините, я в сетях ни бум бум. Если напишете, что сделать - сделаю и выложу...

Аватара пользователя

WWolf
Сообщения: 3874
Зарегистрирован: 14 фев 2018, 00:51
Решено: 28
Откуда: Краснодар
Благодарил (а): 1682 раза
Поблагодарили: 1206 раз
Контактная информация:

не подключается ssh

#4

23 сен 2021, 16:08

ilbor, ну на маке тот же ifconfig и ping 192.168.1.105

no avatar

Автор темы
ilbor
Сообщения: 34
Зарегистрирован: 08 июн 2021, 18:07
Решено: 2
Откуда: Санкт-Петербург
Благодарил (а): 6 раз
Контактная информация:

не подключается ssh

#5

23 сен 2021, 19:48

WWolf писал(а):
23 сен 2021, 16:08
ifconfig и ping 192.168.1.105
а понял. тогда:
(base) ilbor@ilbor:~$ ifconfig
enp42s0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 2c:f0:5d:a8:fa:ec txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

enp5s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.105 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::c16b:a523:608:6e3d prefixlen 64 scopeid 0x20<link>
ether 2c:f0:5d:a8:fa:ed txqueuelen 1000 (Ethernet)
RX packets 2861423 bytes 4329496053 (4.3 GB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1403889 bytes 75943166 (75.9 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Локальная петля (Loopback))
RX packets 450 bytes 78106 (78.1 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 450 bytes 78106 (78.1 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
и
(base) ilbor@ilbor:~$ ping 192.168.1.105
PING 192.168.1.105 (192.168.1.105) 56(84) bytes of data.
64 bytes from 192.168.1.105: icmp_seq=1 ttl=64 time=0.029 ms
64 bytes from 192.168.1.105: icmp_seq=2 ttl=64 time=0.041 ms
64 bytes from 192.168.1.105: icmp_seq=3 ttl=64 time=0.028 ms
64 bytes from 192.168.1.105: icmp_seq=4 ttl=64 time=0.021 ms
64 bytes from 192.168.1.105: icmp_seq=5 ttl=64 time=0.025 ms
64 bytes from 192.168.1.105: icmp_seq=6 ttl=64 time=0.017 ms
64 bytes from 192.168.1.105: icmp_seq=7 ttl=64 time=0.030 ms
64 bytes from 192.168.1.105: icmp_seq=8 ttl=64 time=0.029 ms
64 bytes from 192.168.1.105: icmp_seq=9 ttl=64 time=0.029 ms
64 bytes from 192.168.1.105: icmp_seq=10 ttl=64 time=0.029 ms
64 bytes from 192.168.1.105: icmp_seq=11 ttl=64 time=0.029 ms
64 bytes from 192.168.1.105: icmp_seq=12 ttl=64 time=0.030 ms
64 bytes from 192.168.1.105: icmp_seq=13 ttl=64 time=0.030 ms
64 bytes from 192.168.1.105: icmp_seq=14 ttl=64 time=0.037 ms
64 bytes from 192.168.1.105: icmp_seq=15 ttl=64 time=0.029 ms
^C
--- 192.168.1.105 ping statistics ---
15 packets transmitted, 15 received, 0% packet loss, time 14330ms
rtt min/avg/max/mdev = 0.017/0.028/0.041/0.005 ms

Аватара пользователя

WWolf
Сообщения: 3874
Зарегистрирован: 14 фев 2018, 00:51
Решено: 28
Откуда: Краснодар
Благодарил (а): 1682 раза
Поблагодарили: 1206 раз
Контактная информация:

не подключается ssh

#6

23 сен 2021, 20:21

ilbor, вот тоже самое но с макбука теперь :-D

no avatar

Автор темы
ilbor
Сообщения: 34
Зарегистрирован: 08 июн 2021, 18:07
Решено: 2
Откуда: Санкт-Петербург
Благодарил (а): 6 раз
Контактная информация:

не подключается ssh

#7

23 сен 2021, 21:33

WWolf писал(а):
23 сен 2021, 20:21
ilbor, вот тоже самое но с макбука теперь :-D
блин, я думал речь про мак-адрес, чем бы он ни был :write:
только потом в логах разглядел про макбук

вот с него:
(base) ilya@ilya-MacBookAir:~$ ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Локальная петля (Loopback))
RX packets 76882 bytes 33886950 (33.8 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 76882 bytes 33886950 (33.8 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlp2s0b1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.104 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::81ae:375e:f4a3:ee48 prefixlen 64 scopeid 0x20<link>
ether 70:56:81:ac:93:03 txqueuelen 1000 (Ethernet)
RX packets 620062 bytes 653131568 (653.1 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 323347 bytes 69251980 (69.2 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

(base) ilya@ilya-MacBookAir:~$ ping 192.168.1.105
PING 192.168.1.105 (192.168.1.105) 56(84) bytes of data.
64 bytes from 192.168.1.105: icmp_seq=1 ttl=64 time=1.04 ms
64 bytes from 192.168.1.105: icmp_seq=2 ttl=64 time=1.55 ms
64 bytes from 192.168.1.105: icmp_seq=3 ttl=64 time=1.31 ms
64 bytes from 192.168.1.105: icmp_seq=4 ttl=64 time=1.18 ms
64 bytes from 192.168.1.105: icmp_seq=5 ttl=64 time=1.32 ms
64 bytes from 192.168.1.105: icmp_seq=6 ttl=64 time=1.12 ms
64 bytes from 192.168.1.105: icmp_seq=7 ttl=64 time=1.25 ms
64 bytes from 192.168.1.105: icmp_seq=8 ttl=64 time=1.13 ms
64 bytes from 192.168.1.105: icmp_seq=9 ttl=64 time=1.09 ms
64 bytes from 192.168.1.105: icmp_seq=10 ttl=64 time=1.09 ms
64 bytes from 192.168.1.105: icmp_seq=11 ttl=64 time=1.04 ms
^C
--- 192.168.1.105 ping statistics ---
11 packets transmitted, 11 received, 0% packet loss, time 10014ms
rtt min/avg/max/mdev = 1.040/1.193/1.547/0.145 ms

Аватара пользователя

slant
Сообщения: 4469
Зарегистрирован: 21 июн 2017, 18:09
Решено: 95
Благодарил (а): 51 раз
Поблагодарили: 1966 раз
Контактная информация:

не подключается ssh

#8

23 сен 2021, 21:53

ilbor писал(а):
23 сен 2021, 15:31
а теперь пытаюсь с другого компа подключиться:
Скрытый текст
(base) ilya@ilya-MacBookAir:~$ ssh ilbor@192.168.1.105 -vv -p 22
OpenSSH_8.2p1 Ubuntu-4ubuntu0.3, OpenSSL 1.1.1f 31 Mar 2020
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Reading configuration data /etc/ssh/ssh_config.d/ilbor.conf
debug1: /etc/ssh/ssh_config.d/ilbor.conf line 1: Applying options for *
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug2: resolve_canonicalize: hostname 172.27.237.246 is address
debug2: ssh_connect_direct
debug1: Connecting to 172.27.237.246 [172.27.237.246] port 22.
debug1: connect to address 172.27.237.246 port 22: Connection timed out
ssh: connect to host 172.27.237.246 port 22: Connection timed out
У вас проблема в том, что макбук при попытке подключении клиента ssh лезет на совершенно другой адрес. Вместо вашего сервера на 192.168.1.105 почему-то его несет на 172.27.237.246. Почему - сказать не могу, современных маков у меня под рукой нет, так что...
Возможно у вас что-то нахимичено в /etc/ssh/ssh_config или /etc/ssh/ssh_config.d/ilbor.conf (на маке)
Хотя в 99 процентах случаев, в линуксах в эти конфиги вообще не нужно лазить если это лишь клиент ssh на машине.
И инструкцию которую вы использовали имело смысл привести здесь - может она и виновата.

no avatar

Автор темы
ilbor
Сообщения: 34
Зарегистрирован: 08 июн 2021, 18:07
Решено: 2
Откуда: Санкт-Петербург
Благодарил (а): 6 раз
Контактная информация:

не подключается ssh

#9

23 сен 2021, 22:01

slant писал(а):
23 сен 2021, 21:53
/etc/ssh/ssh_config.d/ilbor.conf (на маке)
вот ведь шайтан машина! и верно, во втором файле конфигурации - был прописан этот ip, это мой рабочий. Похоже, я его когда-то раньше там указал, когда пытался настроить машину еще на работе (там вообще не подключишься извне без vpn из-за брандмауэра).

Исправил адрес, заработало. Спасибо!

Аватара пользователя

Whowka
Сообщения: 1899
Зарегистрирован: 20 июл 2018, 19:50
Решено: 13
Откуда: Питер
Благодарил (а): 777 раз
Поблагодарили: 948 раз

не подключается ssh

#10

23 сен 2021, 22:11

:close:

Закрыто

Вернуться в «Работа с сетью»

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и 10 гостей