Configure your ubuntu desktop as an internet gateway

I have a 3g mobile stick and in certain circumstances I would need to route internet traffic of a PC/server or a particular subnet through this interface. In a windows OS we could simply achieve this by enabling internet sharing on the interface itself. But in the case of ubuntu we can easily enhance ICS (internet connection sharing) feature to a higher level as internet gateway. This way your linux machine can be turned into a gateway which is way cool, isn’t it?

Continue Reading

SSH Tunneling and reverse SSH

One of the tools in any system engineer’s hand as well as those dealing with customer remote service is to set a remote connection to the other end’s server or PC, through VPN, Public IP or any other possible way. One easy yet effective approach is to establish a ssh tunnel by means of reverse SSH.

Continue Reading

Copying Files over the Network with scp

To ”’send”’ file or directory ”’to a remote computer”’:
scp -r [/path/filename] [login name@ip address] :

To ”’retrieve”’ file or directory ”’from a remote computer”’  ”’address in your pc”’:
scp -r [login name@ip address] : [/path/filename]  [/path/filename]

Here are the meaning of scp command options:

-r — recursively copy entire directory
. — current directory


To copy all txt files in the current directory to your home directory on the destination machine:
scp *.txt

To copy txt files to a destination directory. You have to have write permission on the target directory:
scp *.txt

To retrieve files from the other machine back to the one you’re on:
scp*.txt /home/support/Desktop

Continue Reading

How to get the IP address using MAC

It happens alot that you have an IP device (ATA, door phone, …) and you don’t know the IP address. One easy way is to use nmap.

run this command (on linux of course):

$ nmap -sP <ip range>

eg: nmap -sP

make sure you run this as root otherwise it will show only ip address without the MAC

you can also save the output into a txt file this way:

eg: nmap -sP

You can also try using scanssh (next post will cover this)

Continue Reading