Top 5 things to do with a Linux VPS


Virtual Private Server(VPS). As usual, my best vps provider is Linode.

1. Run your own proxy server

Ever got frustrated that you were not be able to access something like spotify or BBC iplayer just because you were not a UK/EU resident? The answer is short and simple..and EFFECTIVE! Get yourself a personal VPS based in London for $20 a month from Linode and install SQUID Proxy on top of it.

2. Run your own web server

Running your own web server might have a lot more advantages than running it on a shared hosting provider.  If you read my older posts, you would realise that gulshan.beejan.com is running on top of Cherokee. Why? Because it’s so easy to manage, lightweight and fast.

3. Configure a reverse SSH tunnel.

Now what’s that?! Well.. it will help you access your office linux computers securely without having to bother about configuring the firewall. For more click here.

4. Make the VPS a remote backup server

With the help of a little bash scripting and the use of NFS drives, you can easily make your VPS a backup server. I usually back up this VPS to my Dedicated Server to make sure that everything is there even after the most painful crashes.

5. Run a ShoutCast Server

If you are willing to go for your own Live Radio, a VPS and ShoutCast is the best combination to go for. Configuration is quite simple.. which reminds me, I need to blog about it sometime soon!

If you have any top things to do.. feel free to post through comments : )

Read More

Reverse SSH Port Forwarding


The way the network configuration has been done at my office makes it impossible to do a port forwarding to access a specific machine outside the network. I figured out that it could be possible to perform a reverse ssh port forwarding.

How-to:
1. You need a server machine that will accept ssh connections : Install ubuntu(because its the easiest to install) on a machine at home. Make sure you do a port forwarding on your router if you have to and map a dynamic dns from dyndns.org on that machine.

apt-get install openssh

2. The host machine at my office(Linux Based) would need to verify the connection to the outside server every time because the IP address of the office is dynamic and the server at your place is not on all the time.

Write a small script remote.sh in /home/username that would do the following:

#!/bin/sh
COMMAND=”ssh -N -f -R 2210:localhost:22 root@mymachine.dyndns.org”
pgrep -f -x “$COMMAND” > /dev/null 2>&1 || $COMMAND

Add that script to your crontab(runs it every 5 minutes)

*/5 * * * * /bin/sh /home/username/remote.sh

3. Perform RSA key pairs

Because the two machines need to authenticate before communicating with each other, we will need to make an automatic login via rsa public/private key pairs.

ssh-keygen -t rsa (Run this on the host machine)

when all steps of the keygen are done,(Press enter until its over, no need to input anything)

cd ~/.ssh/

scp id_rsa.pub root@mymachine.dyndns.org:~/authorized_keys

And you’re done. You should now be able to login to the host machine by login in on the server machine and running “ssh -p 2210 localhost” when logged in as root.

Read More