ssh: Remember each host’s settings

ssh: Remember each host’s settings

When you start using ssh to connect to other linux-based computers, you’re probably only going to a handful of machines. Easy enough to remember the username and hostname, but this won’t do when you’re working on 5 or more servers, especially if some offer ssh on a non-default port.

~/.ssh/config

In this file, you can set all the options for each host, including the username, host or ip, port, even which key to use. Here’s an example:

#Contents of $HOME/.ssh/config
Host dev
HostName 192.168.0.1
User dev-deploy
Port 2222
IdentityFile ~/.ssh/id_rsa.deploy.key

Host prod
HostName www.example.com
User prod555deploy
Port 5899

Host www.example.com
User admin123
Port 5899

It’s that easy! To use this config information, simply ssh:

ssh prod

Happy Computing!

Facebook Cover Photos

Personalizing your Facebook Cover Photo is easy, once you know how to search for one. Here’s a quick guide to help you find exactly what you want:

  1. Go to Google Image Search
  2. Search for something, for instance: Fringe
  3. On the left, click ‘Exactly…’ under Any Size
  4. Enter a width of 851
  5. Enter a height of 316
  6. Now all the images in your results are the perfect size for your Facebook Cover.
  7. Keep on searching to find something uniquely you!

Now, if there’s a watermark/logo, you can remove it in Gimp or Photoshop. Or you can just pick an image without a mark in it.

Happy Facebook-Stalking! j/k lol

Networking Day 4: Wireless Router Setup

A wireless router is a wired router with 1 or more antennae. You should complete the setup of the wired portion before continuing. The router’s admin tool will have a wireless setup section that we’ll be working in today.

Speeds
Most routers and devices use the “G” form of wifi. It’s technical name is 802.11G. It runs at up to 55 Mbps (megabits per second). The “B” form runs at up to 11 Mbps. The latest version, “N”, runs at up to 600 Mbps.

The speed of your connection will be the lower of the router and the device. So, if your router is “B” and your device is “G” or vice-versa, the fastest you’ll go is 11 Mbps. Just like many other things, you network is only as fast as its weakest link.

AP Name & Channel
The Access Point Name is the name that will identify the wireless network. It will only operate on the channel you select. If you notice that something is interfering with your signal, change the channel. 2.4GHz phones are bad interfering with wireless networks, but changing the channel does the trick most of the time.

Wireless Security
Under the wireless section of your router’s configuration, you can setup your security. WEP is the most common type of security used. It uses 128-bit encryption, the same level used by websites that take credit card payments.

Select WEP from the drop down menu and give it a 13 character password. The better the password, the better the security. A good mix of numbers, symbols, uppercase and lowercase letters is best. Try to use acronyms, like NASA or NFL, instead of words.

Windows and MacOS should have an icon next to the clock to setting it up. Tell it to connect to the AP name and it will ask for the password. Linux uses a utility called wpa supplicant which can be setup graphically or by the command prompt.

Where to purchase
You can get these anywhere. You don’t need all the fancy bells and whistles. The biggest question is whether you want wireless or not. If you’re going wireless, go with the “802.11G”.

One of the best places to purchase a used router is the flea market. It sounds a bit shady, but usually honest and good people work up there, and the price is 50% off the retail version.

Networking Day 3: General Router Setup

For almost all home networks, a router connects the local network to the internet via a cable/dsl modem. Most home routers have other features such as DHCP, a firewall, a de-militarized zone (DMZ) and port forwarding. Some even have a usb port to connect a printer for easy use from any computer.

The router actually has 2 IP addresses
Yes, the router has 2 IP address. One is the public IP address. This is the IP address that shows up to the outside world. WhatIsMyIP.com is one of the many sites that can tell you what your public IP address is.

The other is the local IP address. This is on the same subnet as all the computers on your network. This usually ends with a “.1”.

Configuring the router
Most routers can be configured directly from your web browser. All you have to do is type in the local IP of the router. You should be prompted to enter a username and password. These can be found in the manual along with the subnet IP of the router. If you don’t have the manual, you can download them from the manufacturer.

DHCP
DHCP hands out IP addresses automatically. Make sure this option is turned on. It makes life a lot easier. Also, make sure your computers are configured to use DHCP.

Configuring clients
Either set up DHCP on the computers that are connected or assign them a unique IP address in the subnet. I’d suggest going DHCP, as it makes life easier. If you’re brave enough to try static IP addresses, don’t turn off DHCP in the router, in case you mess up the IP address or subnet mask.

Cables
Standard routers use ethernet cables to connect computers to it and to connect it to the cable/dsl modem. These can be hazards if running across the floor. They can also be expensive. If you want to make your own, it’s fairly simple and inexpensive. Click here for wikiHow’s How to Make a Network Cable. You can even get ethernet wall jacks, they look just like phone jacks.

Where to purchase
You can get these anywhere. You don’t need all the fancy bells and whistles. The biggest question is whether you want wireless or not. If you’re going wireless, go with the “802.11G”.

One of the best places to purchase a used router is the flea market. It sounds a bit shady, but usually honest and good people work up there, and the price is 50% off the retail version.

Networking Day 2: Subnets

A subnet is just one small group of computers. What makes it special is that all the computers on the subnet can communicate with each other without a router. All the computers in your house should be on the same subnet.

Subnets can be difficult, but I’ll keep it easy as possible here.

Subnet mask
The subnet mask is used to determine if two computers are on the same subnet. In most home networks the subnet mask is “255.255.255.0”. That subnet mask means that the first three numbers in the IP address must be exactly the same for both computers to be in the same subnet. A subnet mask of “255.255.0.0” means the first two numbers must match.

Here are some examples:

IP AddressIP AddressSubnet maskSame
subnet?
192.168.0.3192.168.0.205255.255.255.0Yes
192.168.0.3192.168.1.3255.255.255.0No
172.16.1.33172.16.33.1255.255.255.0No
172.16.1.33172.16.33.1255.255.0.0Yes
192.168.0.3192.168.0.134255.255.0.0Yes

Subnet notation
In binary, the subnet mask is a string of 1’s followed by a string of 0’s and 255 is eight 1’s in binary. So the netmask “255.255.255.0” is 24 1’s followed by 8 0’s in binary. An IP address in subnet notation is the IP address immediately followed by a forward slash and the number of 1’s in the subnet mask.

Here are some examples:

IP AddressSubnet maskSubnet notation
192.168.0.3255.255.255.0192.168.0.3/24
192.168.1.233255.255.0.0192.168.1.233/16
172.16.10.3255.255.255.0172.16.10.3/24
172.16.10.3255.255.0.0172.16.10.3/16

The gateway
If a subnet is connected to another network, such as the internet, you need a router. A router acts as a gateway for a subnet. It’s IP address usually is “.1” or “.0.1” inside a subnet. So 172.16.10.3/24 would be 172.16.10.1 and 172.16.10.3/16 would be 172.16.0.1.

That’s basic subnets
This is the easy subnetting. Of course, the full subnetting involves masks of “255.255.196.0”, notations of “172.16.33.34/19”, etc. There’s no need to do all that. Most of the time you are safe using the subnet mask of “255.255.255.0”, unless you want to connect more than 253 computers. Why not 255 or 256 you ask? It’s a long story.

Come back tomorrow for how to set up a router.

Home Networks

Now that high speed internet is the norm, more and more people have a home network. A home network is nothing but 2 or more computers connected together via a router. There is more to it than this, but it all boils down to being that simple. To see how it works, let’s trace the internet connection.

If you have cable internet, the signals come into your house over the cable lines. The cable modem converts these signals into an ethernet (looks like a wide phone jack) connection.

If you have DSL internet, the signals come into your house over the phone lines. The DSL modem converts these signals into an ethernet (looks like a wide phone jack) connection.

From the ethernet connection, the internet travels to your router. The router does several important things. It acts as a firewall, blocking people on the internet from accessing your home network. It provides any computer directly connect with a unique IP address which helps the router know what computer is sending/receiving data from the interent.

An IP address is a set of 4 numbers, each 0-255, which identifies a computer on a network. The router uses something called a subnet which is just a group of IP addresses. Most routers use the subnet 192.168.0, which includes all the addresses from 192.168.0.1 to 192.168.0.254. The router is the 192.168.0.1. These addresses might not be the same as your router is using because every router is different.

Because the router has a firewall, you don’t need a firewall on any computer connected to the router, wired or wireless. That means that Windows won’t have to work as hard to protect your computer because you can turn Windows’ firewall off.

A home network isn’t limited to only having computers. A printer can be connected to the network instead of to a computer. After installing the printer software to a computer connected to the network, you can print from another room! A VOIP (Voice Over IP) phone, such as ViaTalk or Vonage, can be connected to the router as well. The list doesn’t stop there either.

WiFi Security

A lot of people have WiFi, or a wireless network. Sadly, many of the WiFi networks are completely open and anyone can log onto the internet and a home network without a password. This is a big security risk. There are plenty of options available, and you won’t have to buy anything extra.

The most common security for wireless routers is WEP security. This requires a 6 or 13 character password to access the wireless network. Without the password, you won’t be able to access it at all.

Almost every router has a web page built in that you can use to change the settings. To get to it, first you have to know the network address of the router; this is always the gateway address of any computer connected to the router. You can find it by click on Start->Run, then type ‘cmd’ and click OK. This should bring up what looks like a DOS box or command prompt. Type ‘ipconfig’ and press enter. Just type the ‘Default Gateway’ address into your web browser.

You should have a login page, if not, please leave a comment with the make & model of router and I’ll see what I can dig up about your router. If you’ve never ever seen this page before, then the factory password is probably still in place. Most of the time the username is ‘admin’ and the password is either ‘default’, ‘admin’, or should be left blank. Again, if none of these work, leave me a comment and I’ll look it up for you.

Once you are logged into the router, there should be a link labeled wireless, security, or setup; Click it. You should see a drop down box with WEP in it. Select WEP. You may have to save settings before you can enter a password, and if this is the case, make sure you are on a hard wired computer, not a wireless one. Make sure you choose 128-bit, not 64-bit which is inferior. Setup your password and save the changes.

You should be all set up. If none of these directions work, please leave a comment or google your make & model router for information on how to set it up. Most sites list step-by-step instructions.

Once you are secured, you won’t have people hoping on your network. Please note that this doesn’t mean that you wireless network is completely secure because everytime there’s new security, hundreds of people try to break it and many succeed.

If you live out in the country with no one around for 200 yards, you are safe enough to run the wireless without any security, but I advise you to set it up anyways, because you never know.