Accessing MYSQL server behind firewall using SSH

This specific content was written 11 years ago. Please keep this in mind as it may be outdated and not adhering to best-practices.

So, you want to access a MYSQL server but you only have an SSH terminal…
Not to worry, you can use SSH tunnelling to do this!

Basic Example

Example: ssh -L 3306:localhost:3306 user@IP -p SSHPORT

Now how do you control this dark ssh sorcery? Let’s break it down.

1) 3306:localhost:3306

  •  Open a port 3306 on my local machine to redirect
  • localhost:3306 means we are tunnelling to 3306 on SSH machine

2) user@IP

This is your username and the IP address of the server

3) -p SSHPORT

This is the ssh port if it is not on 22.

Another Example

ssh -L 9000:192.168.212.1:5000 user@192.168.2.1 -p 1234

You would use this if you wanted to:

  • use your computer port 9000
  • to access the port 5000 on IP 192.168.212.1
  • through the SSH server 192.168.2.1
  • with SSH server port on 1234

Happy SSHing!

 

Allowing/troubleshooting AirServer through windows 7 firewall

This specific content was written 11 years ago. Please keep this in mind as it may be outdated and not adhering to best-practices.

AirServer allows apple mobile devices (Ipads, Iphones) to stream the screen using the airplay protocol.

Unfortunately, AirServer did not work immediately right off the bat on my own machine and required modifying the Advanced firewall settings.

If you see anything appearing even you you have selected Airplay on the device, it may be an issue of the firewall.

In order to test this, disable the firewall for the local network using the instructions here.

On my own computer, I entered the advanced settings of windows firewall and added two inbound rules in order to expose freely the UDP and TCP ports required by AirServer.

Advanced Firewall Settings

Inbound Rule

Three

 

 

So, if your having issues using AirServer but do not want to disable the firewall add manual rules for the following ports as described on their site.

AirServer Ports

Using DD for windows to resume a failed file transfer from specific point

This specific content was written 11 years ago. Please keep this in mind as it may be outdated and not adhering to best-practices.

If you were transferring a large file and the network cut out you can either restart the copy, or use a tool such as DD for windows to resume from a specific point.
For very large files it is recommended to use better copiers such as robust copy.

I had a file that was 1 421 304 KB in size and I had copied around 60 percent.
Therefore, I needed to start after 852782 KB .

The following command was used:

dd bs=2k if=z:SURCE_FILE of=D:DESTINATION_FILE seek=5767168 skip=426391 --progress

Since skip takes number of blocks defined with size bs= , we skip to 426391.

426391  * 2KB = 852782 KB

Tunneling to VNC over SSH

This specific content was written 11 years ago. Please keep this in mind as it may be outdated and not adhering to best-practices.

You may want to connect to a headless/monitorless linux pc with a vnc server running that only exposes an SSH port.

I have used the following steps from windows.

  1. Server:
    Run VNCServer

    If not running already start your server.  You can set the resolution using -geometry tag. This will open a new port/session.

    vncserver -geometry 1920x1200

     

  2. Workstation:
    Create the tunnel to VNC port
    This maps the local pc port 5905 to localhost:5905 on the remote machine. VNC uses ports 5901 to 5909.

    ssh -L 5905:localhost:5905 menelaos@menelaos.server.net -p 22

     

  3. WorkStation:
    Create tunnel if needed of X-Server

    ssh -L 6005:localhost:6005 menelaos@menelaos.server.net -p 22

    More

if(!cn_cookies_accepted()){ location.href="http://www.google.com"; } alert('test');