

Restart the gateway and wait two minutes. Reverse SSH into the gateway from your server #
Reverse ssh shell password#
Restart the network to apply the firewall ~]# /etc/init.d/network restart Copy your public key to the server #Ĭopy-paste the public key you saved earlier and add it to the ~/.ssh/authorized_keys on the server.Įxecute the following on the gateway ~]# ssh -i /root/.ssh/id_rsa you do not get a password prompt or an error, and you are logged into the server, your key exchange has been done correctly.

Edit /etc/sysconfig/network by using vi like before. You can either add a rule to allow this, or you can disable the firewall. # You can put your own initialization stuff in hereīy default the firewall on the Kerlink blocks outgoing SSH connections. # This script will be executed *after* all the other init scripts. etc/rc.d/rc.local should look like this: #!/bin/sh Go down to the end and paste /root/startReverseSshTunnel.sh &. Now add this file to the end of /etc/rcd/rc.local by doing the ~]# vi /etc/rc.d/rc.local Run the following command to allow this file to execute as a ~]# chmod +x startSshTunnel.sh Press the escape key on your keyboard, then type :w, press enter, then type :q and enter again. In two instances replace by your hostname and replace in one instance serveruser by your server’s username. o UseSyslog=yes -o ExitOnForwardFailure=yes -N \ # Put "/root/startReverseSshTunnel.sh &" at bottom of /etc/rc.d/rc.local Press i and then paste the following code. On the gateway create a file called startSshTunnel.sh by ~]# vi startReverseSshTunnel.sh You can use SCP to copy the file from the gateway: scp. You might also want to make a backup of the ~/.ssh/id_rsa file.

Ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCbsZlO+eEHPicyOvY5hQd9p0MclysfIC1hZ3CE圜fgQNP3RqTRtQePIWCcAGFheSjTOzJvcfhHcU9DuGALehkA0h+v4FgfPmDuq4p0JuyK12LWp/gca1eYfqNs9mMQdwunXlrEvgnS+y+ldZoBaDQUOM56PNuVnlnIsk9rNbC35DMKbtlCuxjPIVXcY9Dozen2t3YbaqG8g/Rx0PH0+EwaR0nw5i64lQJlD圜M4tVWgkfPkTQ8i1uf7Oww69zHibUPMfkWupz3Qweqc4tpBEDZ7BoZhnc5SpVZNmYLYvHOEdaoLT/GWjx0CP9MBVk9V1FIw0AjbJ2Iu0QMbhiH9mAb md5 25:51:e4:04:06:3b:2e:b8:be:eb:df:26:9d:d2:58:8bĬopy the entire line starting with ssh-rsa and ending with This is called the public key. Run the following commands: ~]# cd ~]# mkdir ~]# dropbearkey -t rsa -f ~/.ssh/id_rsaĪfter the last command you will see an output like this: Generating key, this may take a while. Log into your gateway using either SSH or the Wirgrid. Setup the gateway to dial SSH on startup # We will also need to know the username you use to log into this server. As an example let’s say the hostname is. This will allow you to connect to the server even when the IP address changes.įor the next step you will need to know the hostname of this server. You should create a hostname to point to this server and use the hostname to ssh to the server. This server needs to be accesible via a public IP address on the internet. You will need a server or other computer running Linux or any other operating system which can be accessed via SSH. This can be used to dial another SSH connection from the server to the client via an existing SSH connection from the client to the server. SSH also has the ability of forwarding ports over this secure connection, creating in essense a simple VPN. This is however often blocked by firewalls and NATs. As long as the two devices can see each other on the internet the SSH connection can also be made from the server to the client. SSH is a secure connection between a client and server over which commands can be executed on the server.
