2

On host1 (server) : sshd with config

Port 56320
AllowUsers user11123

AddressFamily any
ListenAddress 127.0.0.1

TCPKeepAlive yes
Compression delayed

Subsystem   sftp    /usr/lib/ssh/sftp-server

KexAlgorithms diffie-hellman-group18-sha512
Ciphers [email protected]
MACs [email protected]
PubkeyAcceptedKeyTypes ssh-rsa
HostKeyAlgorithms ssh-rsa
HostbasedAuthentication yes
HostbasedAcceptedKeyTypes ssh-rsa
PasswordAuthentication no
PubkeyAuthentication yes

AuthorizedKeysFile /home/user11123/.ssh/authorized_keys

PermitRootLogin no
PrintMotd no
PrintLastLog yes

ClientAliveInterval 30
ClientAliveCountMax 5

SyslogFacility AUTH
LogLevel INFO

and tor with

HiddenServiceDir /var/lib/tor/ssh/
HiddenServicePort 56320 127.0.0.1:56320

iptables disabled.

on host2 : tor and ssh nb with config

host nb
    User user11123
    Hostname __copy_addr_from_host1__.onion
    Port 56320
    VerifyHostKeyDNS no
    ProxyCommand ncat -vvv --proxy 127.0.0.1:9050 --proxy-type socks5 %h %p

KexAlgorithms diffie-hellman-group18-sha512
Ciphers [email protected]
MACs [email protected]
PubkeyAcceptedKeyTypes ssh-rsa
HostKeyAlgorithms ssh-rsa
HostbasedAuthentication yes
HostbasedAcceptedKeyTypes ssh-rsa
PasswordAuthentication no
CheckHostIP no

KeepAlive yes

and result is :

Ncat: Version 7.70 ( https://nmap.org/ncat )
NCAT DEBUG: Using system default trusted CA certificates and those in /usr/share/ncat/ca-bundle.crt.
Ncat: Connected to proxy 127.0.0.1:9050
Ncat: No authentication needed.
Ncat: Error: Host unreachable.
kex_exchange_identification: Connection closed by remote host

tor.log on host2 :

Close 1 streams for service [scrubbed].onion for reason resolve failed. Fetch status: No more HSDir available to query.

please tell me how to set it up

1 Answer 1

0

I have done it through proxy connect in Ubuntu. You may check my blog post, section Remote Control Alternatives for the steps.

https://mstajbakhsh.ir/control-home-iot/

connect to ssh through hidden service

6
  • i have 56-character address ( version 3 )
    – ljgdasfhk
    Jun 5, 2019 at 6:29
  • I think that this is the problem
    – ljgdasfhk
    Jun 5, 2019 at 6:29
  • tor-resolve ysevcxugbwb5n57ltjtpaimnoqjdb6lhte3neasiniusyqd55tvjnayd.onionfe81:f7fa:5793:4e13:5181:f2cf:a5ba:d5fc
    – ljgdasfhk
    Jun 5, 2019 at 8:59
  • torsocks curl $(tor-resolve ysevcxugbwb5n57ltjtpaimnoqjdb6lhte3neasiniusyqd55tvjnayd.onion) curl: (3) URL using bad/illegal format or missing URL
    – ljgdasfhk
    Jun 5, 2019 at 8:59
  • Does tor-resolve uses version 3 of TOR? Because the 56 chars are supported in version 3.
    – Mir Saman
    Jun 8, 2019 at 9:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .