LINUX.ORG.RU

ssh через i2pd ЧЯДНТ

 ,


1

3

есть два компа под ubuntu. у обоих серые ip. хочу ходить по ssh через i2p с 1го на 2й. сейчас это работает через tor, но в свете последних событий думаю скоро перестает.

поставил i2pd. конфиг не трогал. туннели прописал как здесь написано http://i2p2.de/ru/blog/post/2019/06/15/i2p-i2pd-ssh-config

ничего не работает,

ssh -o IdentitiesOnly=yes -p 7622 user@127.0.0.1
kex_exchange_identification: Connection closed by remote host
Connection closed by 127.0.0.1 port 7622

на сервере в auth ничего нет.

в логах i2pd иногда вижу такое, когда пробую ssh запустить

warn - I2PTunnel: Remote destination адрес_ssh.b32.I2P not found

но обычно вообще ничего нет, только какая то дичь вроде

21:11:24@935/warn - Profiling: no profile yet for nMrLKRtypbKvzBQghd5A0fZiGwBW3MsDwH2Zd7df2bg=
21:11:24@935/warn - Profiling: no profile yet for mhgoNLSCjCzMrGoGR8lewMWJ1~NMJ~yzxxZlN12Zn2E=
21:11:24@935/warn - Profiling: no profile yet for iwnb2tBtGyA69xNc92wwdgE0xGLqFtUAXRvmABkYgbI=
21:11:24@295/warn - NetDbReq: No inbound tunnels
21:11:24@295/warn - NetDbReq: No outbound tunnels
21:11:24@306/warn - SSU: session with 213.47.44.179:33577 was not established after 5 seconds
21:11:25@306/warn - SSU: Missing fragments from 0 to 2 of message 491592823
21:11:25@306/warn - SSU: Missing fragments from 0 to 1 of message 491592823
21:11:25@306/warn - SSU: Missing fragments from 0 to 0 of message 491592823
21:11:25@935/warn - Profiling: no profile yet for jFtZM8TtOM4R488b-GqwhMLB1-zEFS9MELJ68z0mUII=
21:11:25@306/warn - SSU: Missing fragments from 0 to 0 of message 1735160357
21:11:25@306/warn - SSU: session with 87.106.208.236:26745 was not established after 5 seconds
21:11:29@306/warn - SSU: Missing fragments from 0 to 0 of message 1264286427
21:11:29@306/warn - SSU: session with 174.59.49.81:34298 was not established after 5 seconds
21:11:30@935/warn - Profiling: no profile yet for tXa9rJOaXWy7FB0jagXeHOb7e-~Svy6iSEic1WCGD8U=
21:11:34@935/warn - Profiling: no profile yet for 0e-M7IYwYKtO-jO4BXZEbpaAkwwv357moHTDO5js2TI=
21:11:35@935/warn - Profiling: no profile yet for mrKSH2ehdIoXFRPBIFwbuMWjkca25ov3YnXuhG015nY=
21:11:35@935/warn - Profiling: no profile yet for wCjzC9seNddEZpBiIId4lz87wwJGDrwdPZuOsILot7w=
21:11:39@935/error - Tunnels: Can't select next hop for c1mUFcjTP64-BBctolxWjNneQ5ton6Ts5zaNK0AGPO0=
21:11:39@935/error - Tunnels: Can't create inbound tunnel, no peers available
21:11:41@306/warn - SSU: Missing fragments from 0 to 0 of message 2714578942
21:11:50@306/warn - SSU: Missing fragments from 0 to 2 of message 1533777073
21:11:50@306/warn - SSU: Missing fragments from 0 to 1 of message 1533777073
21:11:50@306/warn - SSU: Missing fragments from 0 to 0 of message 1533777073
21:11:54@935/warn - Profiling: no profile yet for jyIrxnneRwArMicGZe13DiLT8aXAg~ADJMGOqIeEgOE=
21:11:54@935/warn - Profiling: no profile yet for FkI2ld9xV25MgtUHyn3zcX7wipS-BeizW~dACoWPr74=
21:11:54@306/warn - SSU: session with 109.132.203.157:29147 was not established after 5 seconds
21:11:59@935/warn - Tunnels: test of tunnel 959614782 failed
21:12:04@935/warn - Tunnels: test of tunnel 2119039490 failed
21:12:19@306/warn - SSU: session with 185.234.58.192:27273 was not established after 5 seconds
21:12:19@935/warn - Tunnels: test of tunnel 2861619403 failed
21:12:24@935/warn - Profiling: no profile yet for TxBONMTjGSLwP-i6V8nzDvJ1ActDPYEkkgWlgSCRBLo=
21:12:26@306/warn - SSU: session with 85.25.1.13:32901 was not established after 5 seconds
21:12:59@306/warn - SSU: session with 79.126.12.166:10609 was not established after 5 seconds
21:13:04@935/warn - Tunnels: test of tunnel 1212805340 failed

прошу помощи тех кто настраивал такую связку.. второй день бьюсь ((

еще не уверен насчет .b32.I2P адреса сервера с ssh. смотрел через lynx. если кто подскажет, где этот адрес смотреть из консоли, буду рад )

lynx http://127.0.0.1:7070/ , вкладка I2P tunnels

  i2pd webconsole

   Main page
   Router commands Local destinations Tunnels Transit tunnels Transports I2P tunnels SAM sessions
   Client Tunnels:
   HTTP Proxy ⇐ адрес_HTTP.b32.i2p
   SOCKS Proxy ⇐ адрес_SOCKS.b32.i2p
   Server Tunnels:
   sshd ⇒ адрес_ssh.b32.i2p:2222

tunnels.conf на клиенте


[SSH-CLIENT]
type = client
address = 127.0.0.1
port = 7622
inbound.length = 1
outbound.length = 1
inbound.quantity = 5
outbound.quantity = 5
inbound.backupQuantity = 2
outbound.backupQuantity = 2
i2cp.dontPublishLeaseSet = true
destination = адрес_ssh.b32.I2P
keys = ssh-client.dat

tunnels.conf на сервере


[sshd]
type = server
host = 127.0.0.1
port = 2222
inbound.length = 1
outbound.length = 1
inbound.quantity = 5
outbound.quantity = 5
inbound.backupQuantity = 2
outbound.backupQuantity = 2
i2cp.reduceOnIdle = true
keys = sshd-keys.dat

конфиг, все по умолчанию, не менял

i2pd.conf

## Configuration file for a typical i2pd user
## See https://i2pd.readthedocs.io/en/latest/user-guide/configuration/
## for more options you can use in this file.

## Lines that begin with "## " try to explain what's going on. Lines
## that begin with just "#" are disabled commands: you can enable them
## by removing the "#" symbol.

## Tunnels config file
## Default: ~/.i2pd/tunnels.conf or /var/lib/i2pd/tunnels.conf
# tunconf = /var/lib/i2pd/tunnels.conf

## Tunnels config files path
## Use that path to store separated tunnels in different config files.
## Default: ~/.i2pd/tunnels.d or /var/lib/i2pd/tunnels.d
# tunnelsdir = /var/lib/i2pd/tunnels.d

## Where to write pidfile (default: i2pd.pid, not used in Windows)
# pidfile = /run/i2pd.pid

## Logging configuration section
## By default logs go to stdout with level 'info' and higher
## For Windows OS by default logs go to file with level 'warn' and higher
##
## Logs destination (valid values: stdout, file, syslog)
##  * stdout - print log entries to stdout
##  * file - log entries to a file
##  * syslog - use syslog, see man 3 syslog
#log = file
## Path to logfile (default - autodetect)
#logfile = /var/log/i2pd/i2pd.log
## Log messages above this level (debug, info, *warn, error, none)
## If you set it to none, logging will be disabled
#loglevel = warn
#loglevel = info
# Write full CLF-formatted date and time to log (default: write only time)
#logclftime = true

## Daemon mode. Router will go to background after start. Ignored on Windows
# daemon = true

## Specify a family, router belongs to (default - none)
# family =

## Network interface to bind to
## Updates address4/6 options if they are not set
# ifname =
## You can specify different interfaces for IPv4 and IPv6
# ifname4 =
# ifname6 =

## Local address to bind transport sockets to
## Overrides host option if:
## For ipv4: if ipv4 = true and nat = false
## For ipv6: if 'host' is not set or ipv4 = true
# address4 =
# address6 =

## External IPv4 or IPv6 address to listen for connections
## By default i2pd sets IP automatically
## Sets published NTCP2v4/SSUv4 address to 'host' value if nat = true
## Sets published NTCP2v6/SSUv6 address to 'host' value if ipv4 = false
# host = 1.2.3.4

## Port to listen for connections
## By default i2pd picks random port. You MUST pick a random number too,
## don't just uncomment this
# port = 4567

## Enable communication through ipv4
ipv4 = true
## Enable communication through ipv6
ipv6 = false

## Enable SSU transport (default = true)
# ssu = true

## Bandwidth configuration
## L limit bandwidth to 32KBs/sec, O - to 256KBs/sec, P - to 2048KBs/sec,
## X - unlimited
## Default is X for floodfill, L for regular node
# bandwidth = L
## Max % of bandwidth limit for transit. 0-100. 100 by default
# share = 100

## Router will not accept transit tunnels, disabling transit traffic completely
## (default = false)
# notransit = true

## Router will be floodfill
## Note: that mode uses much more network connections and CPU!
# floodfill = true

[http]
## Web Console settings
## Uncomment and set to 'false' to disable Web Console
# enabled = true
## Address and port service will listen on
address = 127.0.0.1
port = 7070
## Path to web console, default "/"
# webroot = /
## Uncomment following lines to enable Web Console authentication
# auth = true
# user = i2pd
# pass = changeme

[httpproxy]
## Uncomment and set to 'false' to disable HTTP Proxy
# enabled = true
## Address and port service will listen on
address = 127.0.0.1
port = 4444
## Optional keys file for proxy local destination
# keys = http-proxy-keys.dat
## Enable address helper for adding .i2p domains with "jump URLs" (default: true)
# addresshelper = true
## Address of a proxy server inside I2P, which is used to visit regular Internet
# outproxy = http://false.i2p
## httpproxy section also accepts I2CP parameters, like "inbound.length" etc.

[socksproxy]
## Uncomment and set to 'false' to disable SOCKS Proxy
# enabled = true
## Address and port service will listen on
address = 127.0.0.1
port = 4447
## Optional keys file for proxy local destination
# keys = socks-proxy-keys.dat
## Socks outproxy. Example below is set to use Tor for all connections except i2p
## Uncomment and set to 'true' to enable using of SOCKS outproxy
# outproxy.enabled = false
## Address and port of outproxy
# outproxy = 127.0.0.1
# outproxyport = 9050
## socksproxy section also accepts I2CP parameters, like "inbound.length" etc.

[sam]
## Comment or set to 'false' to disable SAM Bridge
enabled = true
## Address and port service will listen on
# address = 127.0.0.1
# port = 7656

[bob]
## Uncomment and set to 'true' to enable BOB command channel
# enabled = false
## Address and port service will listen on
# address = 127.0.0.1
# port = 2827

[i2cp]
## Uncomment and set to 'true' to enable I2CP protocol
# enabled = false
## Address and port service will listen on
# address = 127.0.0.1
# port = 7654

[i2pcontrol]
## Uncomment and set to 'true' to enable I2PControl protocol
# enabled = false
## Address and port service will listen on
# address = 127.0.0.1
# port = 7650
## Authentication password. "itoopie" by default
# password = itoopie

[precomputation]
## Enable or disable elgamal precomputation table
## By default, enabled on i386 hosts
# elgamal = true

[upnp]
## Enable or disable UPnP: automatic port forwarding (enabled by default in WINDOWS, ANDROID)
# enabled = false
## Name i2pd appears in UPnP forwardings list (default = I2Pd)
# name = I2Pd

[meshnets]
## Enable connectivity over the Yggdrasil network
# yggdrasil = false
## You can bind address from your Yggdrasil subnet 300::/64
## The address must first be added to the network interface
# yggaddress =

[reseed]
## Options for bootstrapping into I2P network, aka reseeding
## Enable or disable reseed data verification.
verify = true
## URLs to request reseed data from, separated by comma
## Default: "mainline" I2P Network reseeds
# urls = https://reseed.i2p-projekt.de/,https://i2p.mooo.com/netDb/,https://netdb.i2p2.no/
## Reseed URLs through the Yggdrasil, separated by comma
# yggurls = http://[324:9de3:fea4:f6ac::ace]:7070/
## Path to local reseed data file (.su3) for manual reseeding
# file = /path/to/i2pseeds.su3
## or HTTPS URL to reseed from
# file = https://legit-website.com/i2pseeds.su3
## Path to local ZIP file or HTTPS URL to reseed from
# zipfile = /path/to/netDb.zip
## If you run i2pd behind a proxy server, set proxy server for reseeding here
## Should be http://address:port or socks://address:port
# proxy = http://127.0.0.1:8118
## Minimum number of known routers, below which i2pd triggers reseeding. 25 by default
# threshold = 25

[addressbook]
## AddressBook subscription URL for initial setup
## Default: reg.i2p at "mainline" I2P Network
# defaulturl = http://ффф.b32.i2p/hosts.txt
## Optional subscriptions URLs, separated by comma
# subscriptions = http://reg.i2p/hosts.txt,http://identiguy.i2p/hosts.txt,http://stats.i2p/cgi-bin/newhosts.txt,http://rus.i2p/hosts.txt

[limits]
## Maximum active transit sessions (default:2500)
# transittunnels = 2500
## Limit number of open file descriptors (0 - use system limit)
# openfiles = 0
## Maximum size of corefile in Kb (0 - use system limit)
# coresize = 0

[trust]
## Enable explicit trust options. false by default
# enabled = true
## Make direct I2P connections only to routers in specified Family.
# family = MyFamily
## Make direct I2P connections only to routers specified here. Comma separated list of base64 identities.
# routers =
## Should we hide our router from other routers? false by default
# hidden = true

[exploratory]
## Exploratory tunnels settings with default values
# inbound.length = 2
# inbound.quantity = 3
# outbound.length = 2
# outbound.quantity = 3

[persist]
## Save peer profiles on disk (default: true)
# profiles = true
## Save full addresses on disk (default: true)
# addressbook = true

[cpuext]
## Use CPU AES-NI instructions set when work with cryptography when available (default: true)
# aesni = true
## Use CPU AVX instructions set when work with cryptography when available (default: true)
# avx = true
## Force usage of CPU instructions set, even if they not found
## DO NOT TOUCH that option if you really don't know what are you doing!
# force = false

ssh -o IdentitiesOnly=yes -p 7622 user@127.0.0.1 kex_exchange_identification: Connection closed by remote host

Ты бы ssh -v показал что ли или даже nc -v 127.0.0.1 7622, а не эти простыни. Вангую, у тебя там ни разу не SSH, и полезно могло бы быть знать что у тебя там.

t184256 ★★★★★
()

На втором (сервер) сделай туннель, не надо много лишнего писать.

[ssh]
type = server
host = 127.0.0.1
port = 22
keys = ssh.dat

На первом не надо никаких настроек, просто запусти i2pd, чуток подожди и с него подключайся к первому по ssh
адрес: сервер.b32.i2p
порт: 22

Brillenschlange
()
Ответ на: комментарий от t184256

Ты бы ssh -v показал что ли или даже nc -v 127.0.0.1 7622, а не эти пр

nc -v 127.0.0.1 7622
Connection to 127.0.0.1 7622 port [tcp/*] succeeded!
ssh -v -o IdentitiesOnly=yes -p 7622 user@127.0.0.1
OpenSSH_8.4p1 Ubuntu-6ubuntu2, OpenSSL 1.1.1l  24 Aug 2021
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 *
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 7622.
debug1: Connection established.
debug1: identity file /home/user/.ssh/id_rsa type 0
debug1: identity file /home/user/.ssh/id_rsa-cert type -1
debug1: identity file /home/user/.ssh/id_dsa type -1
debug1: identity file /home/user/.ssh/id_dsa-cert type -1
debug1: identity file /home/user/.ssh/id_ecdsa type -1
debug1: identity file /home/user/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/user/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/user/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/user/.ssh/id_ed25519 type -1
debug1: identity file /home/user/.ssh/id_ed25519-cert type -1
debug1: identity file /home/user/.ssh/id_ed25519_sk type -1
debug1: identity file /home/user/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/user/.ssh/id_xmss type -1
debug1: identity file /home/user/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.4p1 Ubuntu-6ubuntu2
kex_exchange_identification: Connection closed by remote host
Connection closed by 127.0.0.1 port 7622
SANyaSmol
() автор топика
Последнее исправление: SANyaSmol (всего исправлений: 1)

на сервере

[ssh-server]
type = server
host = 127.0.0.1
port = 22
keys = ssh-server.dat

на клиенте

[ssh-pc1]
type = client
address = 127.0.0.1
port = 4257
destination = адрес сервера ssh-server.dat .b32.i2p
destinationport = 22
keys = ssh-pc1.dat

подключатся ssh user@127.0.0.1 -p 4257

анонимность не знаю какая при этом
порт один лишний указан походу, но должно работать

nanosecond
()
Последнее исправление: nanosecond (всего исправлений: 3)
Ответ на: комментарий от SANyaSmol

А с другой стороны ssh точно на 2222 и работает?

t184256 ★★★★★
()
Ответ на: комментарий от nanosecond

теперь i2pd почему то вообще не запускается на сервере. или это

free(): invalid next size (normal)

Aborted (core dumped)

или это в выхлопе

malloc(): invalid size (unsorted)

Aborted (core dumped)

переустановка

apt purge i2pd

apt install i2pd

не помогает

SANyaSmol
() автор топика
Последнее исправление: SANyaSmol (всего исправлений: 1)
Ответ на: комментарий от SANyaSmol

Все заработало. Собрал из исходников на сервере и клиенте последнюю версию с гитхаба https://github.com/PurpleI2P/i2pd . На гите текущая версия 2.40.0, в репах ubuntu - 2.38.0

Конфиги рабочие и с сайта http://i2p2.de/ru/blog/post/2019/06/15/i2p-i2pd-ssh-config , и те что здесь nanosecond выложил. Но с кофигами от nanosecond работает быстрее, поэтому пока на них остановился.. только без destinationport, и без этого работает

Посмотри видео от acetona наглядный пример https://youtu.be/F5iwJ9roGrc?t=1017

ну эт слишком.. я наверно слишком старый, чтобы по видосам с ютуба софт настраивать

SANyaSmol
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.