- Generate key (if necessary):
ssh-keygen -o -a 100 -t ed25519
- Add content of the PUBLIC key to
~/.ssh/authorized_keys
file on the server - Check that
~/.ssh
has 700 and~/.ssh/authorized_keys
has 600 perm (on server)
Create ~/.ssh/config file:
VisualHostKey=yes
Host <name>
Hostname <hostname>
Port <port>
User <user>
IdentityFile /home/<user>/.ssh/<keyfile>
Then you can connect like that:
ssh <name>
'vpn' via ssh
sshuttle -e 'ssh -i ~/.ssh/id_ed25519' -r user@10.20.30.140 10.10.100.0/24
-e
- pass cmd to ssh, here use key
-r
- remote host where we have ssh
10.10.100.0/24
- network to which we want to have access