Skip to content

Rage Against the Shell

Linux tips and other things…

  • Home
  • Contact
  • Privacy Policy

Category: SSH

SSH vpn with sshuttle

Posted on April 9, 2020 by Mr. Reboot

Tested in ubuntu 18

You can build your own vpn secure and fastly with sshuttle. This powerfull tool permits routing all traffic, trough a remote ssh server, by creating several rules on iptables.

Installing:

~ $ apt-get install sshuttle -y

Using:

~ $ sshuttle -v --dns -r user@myserver.domain.com 0/0

-v: verbose
–dns: dns traffic is sending by ssh tunnel
-r: remote server
0/0: destination to route, here all traffic

To redirect traffic for a specific destination:

~ $ sshuttle -v --dns -r user@myserver.domain.com 192.168.0.0/24
Posted in SSHLeave a comment

Prevent disconnections on SSH client

Posted on January 31, 2016 - September 18, 2016 by Mr. Reboot

To prevent disconnections on client side in your SSH terminal you can add this parameter to the configuration file /etc/ssh/ssh_config:

ServerAliveInterval 100

Basically this option will send a null packet to the remote host every 100 seconds and will keep alive the connection.

Posted in SSHLeave a comment

Generate SSH key

Posted on September 5, 2015 - April 24, 2016 by Mr. Reboot

To generate the pair public/private keys type on the shell:

~ $ ssh-keygen -t rsa -b 2048

It ask you for a pass-phrase, it’s important choose a stronge pass-phrase, letters, numbers, symbols etc. If you accept the default path and name for the key it will create two files, the private key, id_rsa, and the public key, id_rsa.pub, in .ssh folder at your HOME:

~/.ssh/id_rsa
~/.ssh/id_rsa.pub

Check permissions, 600 for files and 700 for the .ssh directory.

Now just copy the content of id_rsa.pub and add it to the user home know_hosts file, on the server you want to connect you:

~ $ cat id_rsa.pub >> /root/.ssh/know_hosts

Finally add the private key identity to the authentication agent:

~ $ ssh-add

It will ask you for the pass-phrase, type it. By this way the identity will be stored and now when you try to connect to the server with the public key, you will enter safely without password:

~ $ ssh root@server
Posted in SSH

Search

Calendar

February 2023
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728  
« Jan    

Categories

  • Apache
  • Cisco
  • Command line
  • Distros
  • Dovecot
  • File systems
  • Gadgets
  • GlusterFS
  • MySQL
  • Nginx
  • NTP
  • Opendkim
  • Pacemaker + Corosync
  • Postfix
  • Raspberrypi
  • SSH
  • SSL
  • Varnish

RSS RSS

  • Using qrencode January 16, 2022
  • Compile varnish module vmod_vsthrottle April 22, 2020
  • SSH vpn with sshuttle April 9, 2020
  • Disable swap in systemd December 16, 2019
  • Getting the parent process pid October 12, 2018
Proudly powered by WordPress | Theme: micro, developed by DevriX.