Category Archives: Ubuntu / Debian

Jumping to internal SSH server using Royal TS

It’s a farily common occurrence to have a server only accessible through another server. So I was happy that Royal TS provided an easy way of handling this via their “Key Sequence” setting.

The basic idea is that we first connect to our jump server (ip 1.1.1.1), then we setup a Key Sequence that writes an SSH command to get into the internal server (ip 1.1.1.2)

So this is what the resulting key sequence should look like:

{WAIT:5000}ssh user@1.1.1.2{ENTER}clear{ENTER}

This requires you to first allow passwordless logins, via ssh-copy-id.

A screenshot of a real example:
royalts-jumping

Change DNS servers for a Debian server

Edit the file

vim /etc/dhcp/dhclient.conf

Uncomment the line starting with #prepend domain-name-servers and set your dns servers. Below is an example using the Google Public DNS.

prepend domain-name-servers 8.8.8.8, 8.8.4.4;

(Note removal of hash sign at beginning and two comma-separated DNS servers.)

Reboot and you should be set. You can verify the servers in use by running

dig google.com

The IP for the DNS server will be at the bottom of the output, like this:

;; SERVER: 8.8.4.4#53(8.8.4.4)

iptables rules for Mosh connections

Mosh reqires UDP 60000-61000 to be open and accent connections for it to work. Here is the iptables rule to add that:

sudo iptables -A INPUT -p udp -m multiport --dports 60000:61000 -j ACCEPT

Don’t forget to save the config once you are done, on CentOS the command to save the iptables config to disk is:

service iptables save 

Source