Ubuntu Hardy
Heron has now been officially released. This page was up to date for Ubuntu Gutsy Gibbon, but this information has not been tested with Hardy Heron yet, sorry for any inconvenience. Hardy Heron users should use this web page with caution, there may be differences, but it should be mostly similar. |
| Page Index Introduction. - about this web page. Quick Simple SSH LAN. - Connect two or more computers without internet, LAN or file rescue. Persistent SSH LAN. - Network as many computers as you like to each other and internet too. Firewalls and Security. SSH Networking is good for File Rescues. Setting up the D-Link AirPlus G Dl-524 Wireless Router under Linux Setting up a Thompson Speedtouch 530 Broadband Modem under Linux Set a Static IP address. -If there's no DHCP server in the network. Dynamic IP address. -Use it if your equipment supporst DHCP. IP address. -(for the internet connection) External and Internal IPs. -Your internet IP is different from your LAN IP address. First Time Connection to an SSH Server. If SSH refuses to connect. -Trouble Shooting and Problem Solving. External Links Links About Other Kinds of Networking in Ubuntu. Access to a Windows Network. -Windows networks are easy to access with Samba client. |


| In the client computer: A 'client' is a computer that is being used to make a connection to another machine, remember. The desktop computer will be the SSH client in this example. The desktop's hostname is: red All Ubuntu computers have SSH client software installed in them 'out of the box', so you won't need to install anything for that. I will need to set a static IP address for the Desktop though. In this simple system there's no governing hardware with any DHCP server to give either of the machines an IP address, so we will need to set a static IP address in each computer manually. To set a static IP address I went 'System'-->'Administration'-->'Network', and selected the interface I want to work on. There was a choice of two, wired connection (ethernet card) or modem (dialup). I chose 'wired connection', of course. Then I typed in the IP number I made up: 192.168.1.101 The subnet mask field auto-completed itself. I left the Gateway address field blank. The operating system disconnected the network and re-started it with the new settings. ![]() At this point it is necessary to do 'sudo ifdown -a' and 'sudo ifup -a', or else just reboot. Then do 'ifconfig' and check the IP address.
Okay, now we're going to make a connection, 'Places'-->'Connect to Server', ![]() In the example I'm going to show here, both of the computers I'm going to connect are my own computers. I'm just connecting my own Desktop PC to my own laptop, so I'll simply be logging in as the primary user, (system administrator), which is me. [Note 1] ![]() I set the top spinbox to SSH. The Server field is for the IP number for the server I want to connect to, in this example my laptop,so I typed in 192.168.1.100 because that's my laptop's IP address right now. Port number for SSH is: 22 Folder I want to be in when I connect will be: /home The user is: herman The hostname is: silver Then I clicked the 'Connect' button. If the icon doesn't appear, try rebooting and it should appear then. I right-clicked on the icon and clicked 'Open', from the right-click menu. ![]() I clicked 'Log in Anyway'. ![]() I waited. ![]() I typed in the password for the account I want to log in to in the server computer. Well,
that's it, a window opens and I can see the /home/herman directory in
the laptop. Now I can read and write to my account in the other computer and transfer files between the two computers.If this was a desktop computer with a disabled operating system in it, and we were running a Ubuntu live CD in the CD-ROM drive for the client, we would now be able to perform a file rescue to the laptop's hard drive before trying to repair the desktop's operating system with the Ubuntu Live CD. Note 1: Normally, (for everyday use), we would have a separate user account set up in the SSH server. If the other computer belongs to someone else, they probably like a bit of privacy and wouldn't like you logging in to their account as a long term habit. To set up a new user account in Ubuntu Gutsy Gibbon, you just go 'System' --> 'Administration' --> 'Users and Groups', and you'll see how the other computer administrator can add a new user account for you in their computer that way, it's quite simple. That's the best way to set SSH up for everyday use in your LAN. |


| 1: In the Server computer: In this example, the silver laptop will be the server. You need an internet connection in order to download the SSH server software and install it. Here is the command I use for doing that, Code:
DHCP - Dynamic Host Configuration Protocol The opposite of DHCP is a static or fixed IP address. One of the important settings we use in our computers to enable our computers to be able to access the router or the ADSL modem, which accesses the internet, is 'DHCP'. DHCP is enabled in Ubuntu by default and if the next piece of equipment up the line is enabled as a DHCP server, then our computer will automatically accept whatever IP address the upstream equipment such as the router or the ADSL broadband modem-router wants to offer it. If you make the computer insist it's IP address is one number while the equipment it is trying to connect to is trying to force it to accpet some other number you probably won't be able to make a connection. If you want to check you can always just go 'System'-->'Administration'->'Network', and after you type your password you'll see this 'Network Settings' box here, and if you click the 'Properties' button you'll get this other box illustrated below. ![]() ssh001.png If I tried to set it to a 'static IP address' now, that means I am trying to get my computer to tell my upstream equipment (router or ADSL modem) what IP address I want. That wouldn't work unless I go into the settings in the router or ADSL modem and revert those back to static as well, but who would want static IP addressing when you can have DHCP? DHCP is better. Ubuntu should laready be set to DHCP by default. In that case you don't need to do anything, just leave it like that and go to the next step.
|
| In the client computers: 'Client' computers are computers that are being used to make a connection to a 'server', remember. The desktop computer will be the SSH client in this example. The desktop's hostname is: red All Ubuntu computers have SSH client software installed in them 'out of the box', so you won't need to install anything for that. Okay, now we're going to make a connection, 'Places'-->'Connect to Server', ![]() Normally, (for everyday use), we would have a separate user account set up for each user in the SSH server. To set up a new user account in Ubuntu Gutsy Gibbon, you just go 'System' --> 'Administration' --> 'Users and Groups', and you'll see how the server's system administrator can add a new user account for you in their computer that way, it's quite simple. That's the best way to set SSH up for everyday use in your LAN. In the example I'm going to show here, both of the computers I'm going to connect are my own computers. I'm just connecting my own Desktop PC to my own laptop, so I'll simply be logging in as the primary user, (system administrator), which is me. ![]() I set the top spinbox to SSH. The Server field is for the IP number for the server I want to connect to, in this example my laptop,so I typed in 192.168.1.100 because that's my laptop's IP address right now. Port number for SSH is: 22 Folder I want to be in when I connect will be: /home The user is: herman The hostname is: silver Then I clicked the 'Connect' button. If the icon doesn't appear, try rebooting and it should appear then. I right-clicked on the icon and clicked 'Open', from the right-click menu. ![]() I clicked 'Log in Anyway'. ![]() I waited. ![]() I typed in the password for the account I want to log in to in the server computer. Well,
that's it!A window opens and I can see the /home/herman directory in the laptop. Now I can read and write to my account in the other computer and transfer files between the two computers. Since this might be a permanent set -up, you might also consider clicking the radio button for 'remember forever' (the password). That will store your password for the account in your keyring, you'll be asked to set a new password for your user keyring if it's the first time you have used it. After that you'll only need to remember your keyring password. That's easier in case you have a lot of different SSH connections, all with different passwords. |
| How to set up the D-Link AirPlus G Dl-524 Wireless Router under Linux: If you happen to have a D-Link router like I do, this information might help you. If you have some other brand of router, this info might not all be so relevant for you, but the tip to look for documentation in the CD-ROM might still help. Everyone will need to read their own router's documentation regardless. I just put in the CD-ROM in the drive and browsed around for readme files or files titled help or manual or anything like that.
You need to be plugged in by ethernet cable between your computer and the router to set up the router initially, wireless won't do it. Type the router's IP into Firefox: 192.168.0.1 and press Enter to get into the router's web address. (It is not necessary to be connected to the internet, this web address is inside the router's BIOS or flash memory. This caused a box asking for my username and password to be presented to me. ![]() TIP: Add your router's URL to your Firefox bookmarks, mine is: http://192.168.0.1/ so your router settings and logs will always be instantly available for you from now on. This router, like most other modern routers, has lots of really great settings and interesting features to help improve the usefulness and the security of the LAN. It has a fully configurable firewall and it also has its own log files. If any intruder did manage to get through the ADSL modem's firewall and then also the D-Link router, they will at least be logged. I don't think anyone can get in except probably through the wireless antenna if I leave the wireless settings unconfigured. That would mean they'd need to be within wireless range of my house. They would still need to be able to crack my SSH passwords to get in to any computer, but they could use my internet connection. I have a motel next door where backpackers rest overnight on thier way through on a tour bus. I leave my wireless connection open (at the default settings), so they can email home if they happen to have a laptop and find the connection. Maybe they even use Ubuntu like me. Other people might not want to allow unauthorized wireless connections, especially if you are running a business and have secrets to keep. I can just imagine the beagle boys inside a van parked in an alley huddled around a laptop scanning for a nearby bank's wireless LAN! :) The D-Link router is able to be configured to suit anybody. A router is a good thing to have in a LAN. |
| Thompson Speedtouch 530 Broadband Modem The Thompson Speedtouch 530 Broadband Modem is very popular here is Australia. If you are a Telstra Bigpond ADSL customer you would have that one or another very similar model. When we set ours up we were given a free CD-ROM that would run under Windows XP and set up our broadband modem pretty much automatically, provided we followed the simple instructions exactly and had our username and password correct. Did you know you can also set up the Thompson Speetouch 530 Broadband modem/router under Linux or most other operating systems too? Well you can, the Thompson Speedtouch is actually even based on Linux itself! It has a Linux kernel! There's also a lot of other interesting things you can learn about the Thompson Speetouch 530 Broadband modem too. All the information is available in the documentation already provided by Bigpond, and by Thompson. I'll show you how to find it. Try inserting the setup CD-ROM in your CD drive while you have Ubuntu booted up. Now go for a browse around.
...but wait, that's not all... Now type the URL number 10.0.0.138 into your Linux browser to go to your Speedtouch modem's user interface. NOTE: It is not necessary to have a working internet connection for this, because this web address is actually located inside the ADSL modem's own BIOS or flash memory. It will work even with the internet (phone cable side) completely unplugged. TIP: Be sure to add http://10.0.0.138/index.htm to your bookmarks!
that's all on the Speedtouch for now. I hope you found that interesting. |
| herman@silver:~$ ifconfig eth0 Link encap:Ethernet HWaddr 00:C0:9F:C9:B1:F6 inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::2c0:9fff:fec9:b1f6/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:80 errors:0 dropped:0 overruns:0 frame:0 TX packets:228 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:9498 (9.2 KiB) TX bytes:38545 (37.6 KiB) Interrupt:16 Base address:0x1800 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:22 errors:0 dropped:0 overruns:0 frame:0 TX packets:22 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1720 (1.6 KiB) TX bytes:1720 (1.6 KiB) |

| herman@red:~$ sudo rm -rf .ssh/known_hosts |
Firewalls and Security
External (Internet) and Internal (LAN) IP addresses Our internet connection has an IP address. I'm calling that an 'external' IP address, for the purposes of this page. That's the IP address my modem/router has as far as the outside world is concerned. Inside my house, on my side of the modem/router, my ADSL modem has a different IP address, that is 10.0.0.138 if you have a Thompson Speedtouch 530 like I do. My computers have a different IP addresses each too, allocated by the DHCP server in my ADSL modem/router. If I put another router in between, that will have its own IP address too, and will also assign different IP addresses to each computer. Normally those are invisible unless you use a Linux command like ifconfig to find out. I'm calling those 'inside' IP addresses for the purposes of this page. IP address (External) An 'IP address' is like a phone number but it's for a computer. Well, maybe it would be more accurate in this case to say it's for the connection between your broadband modem and the internet. If you click on any of the following links you'll be able to see your current IP address and a few other things that a web site with the right software can see about you when you visit that site. What Is My IP Address? - Dedicated to IP address discussion What is my IP Address? Show my IP Address and IP Address tracer IP Chicken - What is my IP? Find Your IP Address! My IP Information What can people tell from my IP address? - Ask Leo! Dynamic IP address One of the features of our Bigpond service is that we have a dynamic or 'roving' IP address for our internet connection. Basically that means every time we reboot the ADSL broadband modem and connect back up again we will be given a different IP address. That's a security feature to help protect us and make us more anonymous on the internet. That way it's more difficult for an internet attacker to single out a specific user. If we wanted, we can apply for a 'fixed IP address', which means we can keep the same IP address more or less permanently. That would probably be important if we wanted to make one of our computers into a server to be made available from anywhere on the internet. For example you might want to host and maintain your own website in one of your own computers at home for advertising your hobby or business. You would might want a fixed IP number so people will always be able to find your site. You can use SSH networking between computers over the internet too. That would also be easier if you have a fixed IP address. You could be traveling somewhere and be able to connect to your home computer by SSH to look something up or do work in your home computer. Static IP For Bigpond Broadband ADSL Some ISPs give people 'fixed' IP addresses whether they like it or not. If you have a static IP address it still can be perfectly secure, but you may want to be a little extra careful. MAC Addresses If you want to see your network card's MAC address, use the ifconfig command. MAC addresses are like serial numbers that are hard coded into each piece of networking hardware. They are used to identify your computer's network card, your router, ethernet switching hub, broadband modem-router, and any other piece of networking hardware you can think of. They can be used to identify your equipment on the LAN or internet too. The MAC address might be compared with a license (number) plate on a car. More: MAC address - Wikipedia, the free encyclopedia =========================================================== IPtables are our Linux equivalent to what is called a 'firewall' in Windows. IPtables are built right into the Linux kernel. We don't need to go and download some external software that someone has for sale or for hire. There is often a firewall debate going on in Ubuntu forums about whether or not an added firewall is needed for Ubuntu. I don't think I need a firewall for my purposes. Firestarter, is something we can install in Ubuntu. It might be a good idea to install Firestarter if you install any server software. Firestarter is not a stand-alone firewall that you need to add, but it is a very good GUI frontend for helping new users to configure their IP tables more easily. It's really IPtables that does the work behind the scenes. Firestarted can be installed through apt or Synaptic Package Manager or 'Applications, Add/Remove Programs'. There are some other similar programs available too. Howto: Setup a Software Firewall in Linux using Firestarter - Techthrob.com In Ubuntu, our IPtables are left unconfigured by default. When we first install the operating system they aren't needed, because Ubuntu doesn't come with any services installed, no ports are open to the internet. As long as we don't open any services, Ubuntu is as sealed as a nut. Most people probably don't even realize Ubuntu has a network filter (or 'firewall' if you prefer). If you want to take a look at yours, just do this, Code:
And here's what our unconfigured IPtables normally look like,
man iptables To learn more about iptables open a terminal and type: man iptables The output from that command is about eight pages long and it's very interesting if you have the time to read and inwardly digest it. There is a lot to learn about IP tables. I have links to some of the best web pages with how-tos and user guides for IPtabels further down this page. I haven't configured my IP Tables at all, and I have installed SSH server. I want to check to see how safe I am on the internet. You can do this too. So let's go test our firewall. 'Shields Up!' is a well known internet firewall testing site, your Ubuntu system should pass all tests as 100% stealth with or without any added firewall. I don't use any added software firewall and mine is 100% stealth, and has always been. It will tell you your external IP also. AuditMyPc.com is another firewall tesing site you can visit. HackerWatch.org is good too. Did your Ubuntu operating system pass all those tests? Mine did, ...but I was connecting through my router, and then through my broadband modem. Both my router and my broadband modem have 'hardware firewalls' built into them. (I highly recommend the hardware firewalls in most routers), so it could be that these firewall testing sites are only really testing my 'hardware firewall' in my router. If you are connecting through a router too you can unplug your router and plug Ubuntu into the broadband modem directly if you want and have another try! (Some of you may need to revert back to DHCP first, to make a direct internet connection). Stealth? Try doing the specific port probe at 'Shields Up! on port 22, (the SSH port) now, still 100% Stealth? CanYouSeeMe.org - Open Port Check Tool - Check just one port at a time - any port. Given the results from the above tests, it would seem as if at least my computers are already quite secure from the outside world, I'm not sure about everyone else's. That depends on your equipment. Port Scanning with Ubuntu (your other computers in your LAN) If we have more than one Ubuntu computer in our network we can use each one to scan the others for open ports. Ubuntu comes with some very good networking software of its own. I went 'System'-->'Administration'-->'Network Tools', and clicked on the 'Port Scan' tab. You need to know the IP number for each of your other computers that you want to scan. The easiest way to get that is just to go to the other computer and run 'ifconfig'. The scan only takes a few seconds. It is possible to detect an open port 22 that way when a system has SSH server installed. If you find any other open ports you can look them up in either of these links to see what service they're probably for: If you don't remember installing that service or if it's a service you don't use then you should probably uninstall the service and that will probably close the port.
NMap NMap is a port scanner you can use for checking all the computers in your LAN for open ports. http://insecure.org/nmap/docs.html Nmap is installable in Ubuntu through apt-get, Add/Remove Programs or Synaptic Package Manager. A nice GUI front end is available for NMap too, it's called 'NmapFE', and is available through Add/Remove Applications, and probably apt-get and Synaptic too. WireShark. - http://www.wireshark.org/ Wireshark is installable in Ubuntu through apt-get, Add/Remove Programs or Synaptic Package Manager. Wireshark is a packet sniffer, you can use that to keep a watchful eye on the comings and goings of all the packets in your LAN. Connecting from another computer on the internet to a computer inside a home LAN If your setup is anything like mine, you would need to open a port in the broadband modem's firewall, and also a port in the router's firewall before the incoming connection could be made. That will expose your LAN to the internet. That's where you might start needing to be more security conscious about computers in the LAN with open ports. What if a remote attacker can get into my LAN from the internet ever did (theoretically) manage to get inside my LAN through my Broadband Modem-Router's built-in firewall and my LAN router's firewall too? (You're joking right?) Well, according to this link, Getting Started with SSH, they would still have a hard time cracking my SSH password. Quote:
How to tell if someone is trying to crack into your computer HOWTO: Automatically block SSHD/PROFTPD Attacker. - pinoyskull Seahorse -Encryption Made Easy - http://www.gnome.org/projects/seahorse/ See this website's Install Seahorse. Seahorse is a nice GUI application that makes and manages both PGP and RSA keys. We can install Seahorse in Ubuntu easily through 'Applications'-->'Add/Remove Programs' or Synaptic or apt-get.
WIth RSA keys we can log in to our SSH accounts even more securely without even having to bother typing the password each time. Seahorse generates for us a pair of keys, a private and a public RSA key. These are saved is in the .ssh directory in a file called rd_rsa and a file called id_rsa.pub. The file called rd_rsa contains our private key which we need to keep secret. The file called id_rsa.pub contians our public key which is to be copied to our friend's computer, which we want to connect to. To set up passwordless logins for SSH, we open Seahorse and right-click on our Private RSA key. Select 'Set up Computer for Secure Shell...' A window opens titled 'Set up Computer for SSH Connection', and below that, there's a note: 'To use your Secure Shell key with another computer, you must already have a login account in that computer. There's a field under that called 'Computer Name', (domain name). I just type the IP number: port number (if other than 22), of the friend's computer there, that works for me. There's also a field for your login name in the other computer, which is autocompleted. When you are ready, click 'Setup'. You'll be asked for the password to your account in your friend's computer, type it and click 'Okay'. That's it! Your public RSA key is copied into your friend's computer, it's appended to a file called .ssh/authorized_keys. Now when you open an SSH connection to your friend's computer, you may be asked for a keyring password for the first time connection, but after that the login should be automatic. The way it works is something like this, the computer you are connecting to uses your public key to generate a number and encrypts the number and sets the encrypted number to your computer. Your computer uses your private RSA key to decrypt the number and sends the unencrypted number back to your freind's computer. When your freind's computer receives the number back decrypted, that proves the identity of the computer you are using is genuine, since only your private key could have decrypted that number. The remote computer allows the connection and opens. After the first time connection it's automatic, you don't need to type a password anymore. Then once we have passwordless logins established we can edit /etc/ssh/sshd_config files to disable password based logins, for even more security. What is a Digital Signature? An introduction to Digital Signatures, by David Youd How PGP Works | Dr. Small's Blog | Public Key Cryptography - Wikipedia The International PGP Home Page
ADSL is short for 'Asymetrical Digital Subscriber Line'. 'A' stands for 'Asymetrical', because it's set up so that downloading is faster than uploading. 'D' is for 'Digital', (instead of analog or ISDN). 'SL' is short for 'Subscriber Line', which just means a phone wire. Using Digital means we can have the phone plugged in and use it while the computer is on-line since it's a different frequency. Our phone wires can carry about 200 times the amount of information using digital signals compared to analog too. The speed of internet connections are stated in KiloBits per second is written like: 256/64 kbps, or 512/128 kbps. One kilobit is roughly about 1/10 of a Kilobyte. The Data Transfer Rate Conversion Table. |
| /////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Website Under Construction The information above here is often being updated Thanks for your patience and sorry for any inconvenience Proceed with caution /////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ |