29
Linux Laptop – Ubuntu Howard Gibson 2018/11/24 Contents 1 Introduction 1 1.1 Objective ............................. 1 1.2 Copyright ............................. 1 1.3 Why Linux? ............................ 1 1.4 Summary ............................. 3 1.4.1 Installation ........................ 3 1.4.2 DVDs ........................... 3 1.4.3 MBR and GPT Formatted Disks ............ 4 2 Hardware 4 2.1 Laptop ............................... 5 2.2 CPU ................................ 5 2.3 Memory .............................. 5 2.4 Hard Drive ............................ 5 2.5 DVD ................................ 5 2.6 Video Card ............................ 5 2.7 Monitor .............................. 5 2.8 Sound Card ............................ 5 i

Linux Laptop { Ubuntu - home.eol.cahome.eol.ca/~hgibson/LenovoUbuntu2.pdf · Ubuntu’s default behaviour is to install a /boot primary partition, and a logical partition containing

  • Upload
    others

  • View
    15

  • Download
    0

Embed Size (px)

Citation preview

Linux Laptop – Ubuntu

Howard Gibson

2018/11/24

Contents

1 Introduction 1

1.1 Objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.2 Copyright . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.3 Why Linux? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

1.4.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . 3

1.4.2 DVDs . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

1.4.3 MBR and GPT Formatted Disks . . . . . . . . . . . . 4

2 Hardware 4

2.1 Laptop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.2 CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.3 Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.4 Hard Drive . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.5 DVD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.6 Video Card . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.7 Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.8 Sound Card . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

i

2.9 Modem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2.10 Keyboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2.11 Webcam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2.12 Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2.13 Battery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2.14 Slots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

3 Installation 7

3.1 Planning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

3.2 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

3.3 Partitioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

3.4 Sudo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

3.5 Install Media . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

3.6 Text Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

3.7 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

3.8 Logging in for the first time . . . . . . . . . . . . . . . . . . . 13

3.9 Exploring the Desktop . . . . . . . . . . . . . . . . . . . . . . 13

3.10 As Installed Partitioning . . . . . . . . . . . . . . . . . . . . . 14

3.11 Firewall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

3.12 Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

3.13 Terminal Sessions . . . . . . . . . . . . . . . . . . . . . . . . . 17

3.14 New Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3.15 Bluetooth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3.16 Printer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

3.17 More Software . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

3.18 Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

3.19 Window Managers . . . . . . . . . . . . . . . . . . . . . . . . 20

3.19.1 XFCE . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

3.19.2 LXDE . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

ii

3.19.3 Other Window Managers . . . . . . . . . . . . . . . . . 21

3.20 Fortune Cookie . . . . . . . . . . . . . . . . . . . . . . . . . . 21

3.21 More Security . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

3.21.1 Disable Ping . . . . . . . . . . . . . . . . . . . . . . . . 22

A Backups 23

B Mounting a USB Stick While Installing 24

iii

iv

1

1 Introduction

1.1 Objective

Test the default installation of a popular Linux distribution, in this case,Ubuntu-18.04.1-desktop-amd64).

I have been installing Linux since 1995. I have been formally trained in UNIXadministration. I have developed all sorts of installation and usage habitswhich are of no interest to ordinary people who might be tempted to installLinux. The install instructions for my regular computers show all sorts ofcustomizations I like to do.

I want to know how easy it is for an ordinary mortal to install Linux. I willdo a standard installation. I will customize only if something important ismissing. I will not use vi.1 I will use the editor nano if absolutely necessary,but I will use easily located graphical administration tools whenever possible.

The additional assumption on this install is that the user is limited in fundsand other resources. I will assume that the computer is an old clunker. Theprimary problem is that they lack an external backup drive, making properpartitioning critical.

The OS is Ubuntu-18.04.1-desktop-amd64), downloaded from Ubuntu’s web-site, 2018/11/12 The installation was on 2018/11/12.

1.2 Copyright

This document is copyright c© 2018 by Howard Gibson. You may post thison web pages and bulletin boards free of charge. All other rights are reserved.

1.3 Why Linux?

Linux is Free Software. Your computer should not be encumbered by copy-rights and Digital Rights Management (DRM). Proprietary software publish-ers are trying so hard to prevent unathorized copying that they can prevent

1 Bill Joy from Sun Microsystems, wrote vi back in the seventies. It is the standardUNIX system administration text tool, and UNIX/Linux administrators are expected toknow it.

2 1 INTRODUCTION

you from installing and using copies you purchased, and are authorized touse. Also, if you cannot run the application you used to create your data,you don’t own your data!

Linux is not hard to install on most computers. The latest “bleeding edge”video and sound cards may give you trouble. If you are buying a new com-puter, you should do some research on the hardware. If your computer isolder, Linux should have all the drivers you need. You need to research Linuxsupport on printers and scanners. Not everything works.

A basic Linux install will include some very good graphics programs, par-ticularly GIMP, a good substitute for Adobe Photoshop. Just about everyprogramming tool is available for Linux, except for the proprietary Microsoftones like Visual Basic and C#.

Linux can run efficiently on older, slower computers, because you can selectsmaller, faster user interfaces and applications. Install the window managersXFCE and LXDE. Libre Office is a credible alternative to Microsoft Officebecause it is just about as bloated as Microsoft Office. Try the word processorAbiWord, and the spreadsheet Gnumeric. You could learn to use LATEX,whose files are edited with a text editor.2

Linux is less capable at video games and multimedia. There are lots of FreeSoftware computer games out there, but the best stuff is commercial andproprietary. Few publishers support Linux.

The big problem with Linux and multi-media is ideological. Most mediaformats are proprietary. GNU and Linux are the work of Free Softwarepeople, who are reluctant to support proprietary formats. If you spend anhour or so surfing GNU.org , you will understand who you are dealing with.The GNU “Copyleft” really is a copyright. All copyrights are supported bythe Free Software community.

Linux can be made to support multi-media. I watch YouTube and Netflixon my Linux box. I can watch most commercial DVDs. Don’t expect theFree Software community to knock itself out to help you.

For more information on the thinking behind Free Software, just follow thelinks. You can get support for most media formats. Just search Google forLinux multi-media support.

2 This document is maintained in LATEX. The best reference on LATEX is A Guideto LATEX 2ε by Helmut Kopka and Patrick W. Daly, Addison Wesley books. This bookprovides good document templates. I have not found other references to be useful.

1.4 Summary 3

1.4 Summary

1.4.1 Installation

A default new installation of Ubuntu took about an hour, and it was easy.The machine will have properly configured user accounts, and a workingfirewall. There are some nasty UNIX tricks that will improve security, butthese are not absolutely necessary.

On an earlier install, Ubuntu 18 refused to install on my 32 bit computer.This version did, with no problems.

Ubuntu’s default behaviour is to install a /boot primary partition, and alogical partition containing only a root partition. This time, I forced Ubuntuto create a /home partition separate from root. This makes the install a littlemore complicated, but it gives you the security of being able to keep /home

intact during any new Linux installs. This could be important if you cannotaffort a 4TB USB drive for backup.

Ubuntu is not able to conveniently encrypt the hard drive in this configura-tion. That is not a problem for a desktop that stays at home. A laptop thatis transported through or used in risky locations, should be encrypted.

Ubuntu sets up user directories with read-write access for the user, and readaccess for everyone else. Fedora allows access of any kind only to the user.I strongly prefer Ubuntu’s approach. If you are setting your file systems upfor a work group or for your family, you should trust everybody. Folders con-taining private stuff can be locked down by the users. Email tools generallykeep non-users out of email folders.

1.4.2 DVDs

Download install images from the internet. These can be burned to DVDsand CDs, which is what I normally do. You can copy the image to aUSB stick. There are instructions for this on the internet. Many computerthese days do not have CDROM/DVD readers.

If you are interested in Linux, buy one of the books. Periodically, I buy one ofthe Linux Bibles. You get documentation, and you support the community.Before you visit the bookstore, check the internet and find out what versionsof Linux are current. The stores sell surprisingly old books, often on a shelfright next to the current book that you ought to be buying.

4 2 HARDWARE

1.4.3 MBR and GPT Formatted Disks

If you are buying a new hard drive for an old computer, you need to readthe following carefully.

New computers are being shipped with GPT formatted hard drives, andmotherboards that can use them. GPT is a more advanced disk format.Among other things, it allows many more primary partitions. The oldMBR format3 only allows four. For my Fedora 26 install onto my new harddrive, this was a very nasty surprise. My Gigabyte GA-990FXA-UD3 Ver-sion 1.1, motherboard4 did not work with my new hard drive, a WesternDigital WD2003FZEX-0. The installed system showed the boot screens,then “Loading Operating System ...”, then it stopped. After a week of futilehacking, I bought a new 2TB hard drive, and now everything works! theWD drive now is my /archive drive. It works. I just cannot boot from it.

If you are installing Linux on an old clunker computer and an old drive, youshould have no problems. If you are installing Linux on a new computer witha new, GPT capable motherboard and GPT formatted drive, you should haveno problems. The fun starts when you replace the hard drive on your oldclunker.

If you are buying a new hard drive for your old computer, ask questions at thestore. My non-functional drives were from Western Digital. My functionaldrive is from Seagate.

A crude rule of thumb is that if your “new” machine is working with whateveroperating system you have, your Linux install will work.

2 Hardware

This is a Lenovo Thinkpad T400. I purchased it second hand at Laptops forLess, at 3358 Lakeshore Blvd, in Etobicoke, Ontario.

The machine has a double density DVD burner, an Ethernet connection, andthree USB ports.

3 MBR stands for Master Boot Record. GPT means GUID Partition Table. GUIDmeans Globally Uniquie IDentifiers. I don’t know the significance of any of this.

4 The Gigabyte GA-990FXA-UD3 Version 3.0 is capable of booting GPT drives.

2.1 Laptop 5

2.1 Laptop

Lenovo Thinkpad Model 6475GZ5, Serial Number R8-GEFYN 09/11

2.2 CPU

Intel Core 2 Duo CPU P8400 2.26GHz

2.3 Memory

It came with 4GB, in the form of two 2048MB DDR3 SD-RAM.

2.4 Hard Drive

ATA HDD0: Hitachi HTS723216L9SA60-(S1) listed at 160GB.

2.5 DVD

ATAPI CD0: Matshita DVD-RAM UJ862A-(S2)

2.6 Video Card

Intel HD graphics with up to 1.6 GB of shared video memory. This supportsan external monitor 1920x1200 16 million colours.

2.7 Monitor

14.1” 1280x800, and 16 million colours

2.8 Sound Card

Realtek codec ALC269 with 2-channel High-Definition (HD) audio

6 2 HARDWARE

2.9 Modem

Protocols & Specifications: ITU V.90, Max Transfer Rate: 56.0Kbps, Fea-tures: V.92 upgradable.

This is a “soft” modem requiring drivers, as opposed to a hardware modemthat just works. Linux drivers probably are available, but they are not FreeSoftware. When was the last time you used a modem?

I have gotten these modems working way back in the distant past.

2.10 Keyboard

Laptop keyboard with touch-pad and nipple. Cool! Also, there are two sets ofmouse buttons. The buttons near the nipple include a middle button. Withthe X Windows System graphical user interface, this is very good indeed.

2.11 Webcam

Oh oh!

1.3 megapixels with digital microphone. This camera has an LED that goeson when the camera is running.

Gnome comes with something called cheese to operate webcams.

I have tried running cheese remotely, using another computer as the display.It could not find a device. This is good. We do not want the webcam runningremotely.

Recent articles in the news show that webcams and impressionable younggirls are a bad combination. I don’t have a young girl, impressionable orotherwise, so there is no problem for me. I will refrain from taking myclothes off when asked. I promise!

Facebook is being blamed for recent teen suicides. Facebook does not havea live “please take your clothes off” feature. I suspect that the real culpritis Skype, which is available for Linux.

Like all other web-enabled devices, the webcam in your daughter’s bedroomwill be inaccessible to the internet if it does not exist. My newer Lenovolaptop does not have a webcam.

2.12 Network 7

2.12 Network

Integrated 10/100 Ethernet LAN

Atheros XSPAN BGN (802.11BGN) wireless

Bluetooth V2.1 technology

Wireless: 802.11 a/b/g/n (draft), Bluetooth 2.0, Network Interface: GigabitEthernet

2.13 Battery

6-cell Lithium ion

I have replaced this with a higher capacity battery, which give me a lifespanof around four and a half hours.

2.14 Slots

ExpressCard/54

3 Installation

3.1 Planning

I have replaced this machine with a newer, faster laptop. This now is a playtoy.

Newer machines all are 64 bit. Linux is a good way to extend the functionallife of older machines. Google Chrome is available for Linux in 64 bit, only.

I will treat this as a user’s primary computer. The machine must have emailand web surfing tools, as well as a Microsoft Windows compatible office suite.The ability to read and to save files in Microsoft DOCX, XLSX and PPTXis necessary.5

The user may have a family, and they may want to create extra accounts.

Programming is not necessary, but I will look at this as an option.

5 If you share office files, you should stick with the older DOC, XLS and PPT formats.If people’s computers ain’t broke, they don’t fix them.

8 3 INSTALLATION

3.2 Security

This machine is a laptop. Normally, since a laptop is transported, and isvulnerable theft and to cracking, I want the hard drive encrypted. Ubuntudoes not provide this capability with custom partioning.

I am determined to do custom partitioning on this install. This machine willbe configured as a home desktop.

3.3 Partitioning

Linux installers break the hard drive up into separate partitions.

There are two important issues with partitioning. I assume you plan to useyour computer for a fairly long time. Eventually, you will want to re-installLinux to get a more advanced version, or perhaps, a different distribution.

1. You need a root partition large enough to hold the newer version of theOS.

2. You do not want to harm your /home partition. This is where all ofyour data will be stored.

Device Type Mount Point Approx Size Remark/dev/sda1 ext4 /boot 2MB primary partion/dev/sda2 ext4 / 40000MB primary partion/dev/sda3 ext4 /home 118000MB primary partion

160000MB Total

I am splitting the hard drive up into primary partitions. A primary parititioncan be split up a series of logical partitions. This allows more parititions onthe older MBR drives. A split primary partition can be encrypted, butUbuntu does not provide this option.

There are work-arounds to allow an encrypted, multiple partition Ubuntusystem, but these are too complicated for the beginner installation I amdocumenting.

I have provided the separate /boot partition because Ubuntu does this on adefault install. It is only 2GB.

3.4 Sudo 9

3.4 Sudo

There are two ways to administer UNIX/Linux. You can have a root account,or you can use sudo.

Historically, UNIX type systems are installed with a super user account calledroot. This account has complete write access to everything on the computer.This is dangerous. Good practise is not use this account for anything otherthan system administration. When you are logged in as a regular user, yourability to damage your system is drastically reduced.

When you open any sort of UNIX/Linux terminal or shell, you are promptedby a text string ending in a dollar sign, $.6

When you log in as root, the prompt changes to a pound sign, #, also calleda hash sign in the computer world. This is a sign of danger. The hash signsays you are root, and you can trash the system if you are not careful.

An alternate approach for all this is to not have a root account. A group ofusers are designated as administrators. To issue a root command, they go

$ sudo nano /etc/group

The system prompts for the user password. The resulting increased accesscontinues throughout the session.

This is used on Ubuntu Linux and on MacOS. I prefer to keep the root ac-count. When I am logged in as root, I can see the hash sign, and I know thereis a threat. On a single user machine, like mine, sudo makes administrationeasier, and reduces the number of strong passwords you need to track. Thismay be one of those six of one, half dozen other issues.

Up to version 27, Fedora creates a root account. Fedora 28’s default installset up sudo.

6 The command line prompt is configurable. Fedora’s current default is to show theuser name, the computer name and the current directory. If you want to change this, youwill have to read up on it.

10 3 INSTALLATION

3.5 Install Media

The files you download from the distribution websites are ISO files. These areused to create potable DVDs or USB sticks. I find DVDs easier to manage.If your machine lacks a DVD reader, you will have to search the internetto find out how to install an ISO image onto your USB stick. The ISO forUbuntu 16.04.5, 32bit, is 1.6GB. Any cheap old USB stick will work. Ifyour computer will not boot from USB, you will have to pick up a USBDVD reader.

3.6 Text Editing

This document is written mostly with the text editor vim, a version of vi.This is an extremely efficient and productive editor once you learn it, espe-cially if you are a touch typist, like me. It is especially efficient with largedocuments, since you can navigate by doing the text seaches through thecommand line. It is the text editor of UNIX and Linux geeks everywhere.Unfortunately, it is mindbogglingly not user friendly.

Linux newbies need to try something else. You need a text editor that runsin a terminal session. You don’t always have the X Window System runningwhen you do administration.

The text editor nano, is available and strongly recommended. You navigatearound the text file using the arrow keys, just like you think it should. Ithas a CTRL key menu at the bottom of the screen.

When you are told to edit configuration files, use nano.

3.7 Installation

I mean to do a wireless installation. Plugging into your wired network isfaster and way more reliable, but sometimes, you have to do wireless.

1. You may have to go into your BIOS and select the boot device withyour OS on it.

2. Insert the DVD or USB stick, and boot the machine.

3.7 Installation 11

3. Wait.

4. Wait some more.

5. Eventually, the GUI window7 comes up, and then the “Welcome” win-dow appears. You can Try Ubuntu or you can Install Ubuntu. Let’sinstall it.

6. The “Wireless” window has come up. Select your local WiFi networkand hit [Connect].

7. It worked! Hit [Continue] to get to the next window.

8. The “Preparing to install Ubuntu” window comes up. There are twochoices here,

• Download updates while installing Ubuntu,

• Install third party software for graphics and Wi-Fi hardware

Flash8 MP3 and other media.

The second choice will install all sorts of not-free software. If youwant to be a strict Free Software person, you should not select this.Otherwise, select both.

9. The “Installation Type” screen comes up.

• Erase disk and install Ubuntu.

– Encrypt the new Ubuntu installation for security.

– Use LVM with the new Ubuntu installation.

• Something else

Select Something else.

10. The “Installation Type” window comes up, showing off your partitiontable. If this is a new install, hit [New Partition Table].

7 GUI stands for Graphical User Interface.8 Flash is being discontinued in the industry because of security problems. I hope this

is not installed.

12 3 INSTALLATION

(a) Your partition should show the line /dev/sda,9 then a second lineshowing “free space”. Click on “free space”.

(b) Click on [+].

(c) The “Create a partition window” come up. Set the size to 2000MB.

(d) Set the paritition type to Primary.

(e) Leave the “Location” at its default value.

(f) Leave “Use as” at EXT4.

(g) Set the mount point to /boot.

(h) Click [+] again, and create a / partition with 40000MB.

(i) Click [+] again, and create a /home partition and leave the size atthe default value. You want all the remaining space on the drive,in this case, around 118000MB.

Device Type Mount point Format? Size/dev/sda1 ext4 /boot y 1998 MB/dev/sda2 ext4 / y 40000 MB/dev/sda3 ext4 /home y 118041 MB

11. If this is a re-install, you do not want to re-format /home.10 Click thebutton to turn off Format.

12. Click [Install Now].

13. You will be prompted asking if changes are to be written to disk. Thisis your last chance to not wipe everything out and replace it. Hit[Continue]. I did this at 1:55pm.

14. Now it is asking “Where are you?”. It recognized that I am in Toronto!Hit [Continue].

15. Now it wants to know “Who are you?”. Provide your name, pick aname for your computer, then select a password. Now how the installerrates your password. Definitely, require your password to log in. Hit[Continue].

9 If you have an additional hard drive, it will be /dev/sdb. I prefer to do the en-tire GNU/Linux installation on one drive. There are lots of cool things we can do withadditional drives.

10 The whole point of partitioning is that you want to protect /home from new installs.

3.8 Logging in for the first time 13

16. A bunch of windows scroll by, telling you what is being installed. Atsome point there are notes above the progress bar that talk about“removing” stuff. This has to be the updates we have selected.

17. The installation completed at some time before 2:20pm. Hit the button.The DVD will be ejected, and you will be instructed to reboot.

18. I had to reboot my machine manually.

3.8 Logging in for the first time

You reboot the machine, and you log in. You are in Unity, which is Ubuntu’sversion of Gnome 3. It is connected to my wireless network, so it rememberedmy wireless connection on installation.

There is a “What’s new in Ubuntu” window. I clicked [Next].

The next window is “Livepatch”, which prompts me to install some updatesto secure my computer. This requires me to have a Ubuntu account. I don’thave one, so I skipped this step by hitting [Next]. If you are serious aboutUbuntu, you probably should hit this.

The next window is “Help improve Ubuntu”. This looks like it will broadcastinformation about your computer and where you are located. I just hit[Next] again.

I found a “Software Updates” window. Do I want to install update? Yes. Ihit [Install Now], and I was prompted for my password.

3.9 Exploring the Desktop

Unity shows icons down the left hand side of the screen below the word“Activities”. From the top down. . .

• Firefox – web browser

• Thunderbird – email

• A file cabinet icon – file manager

• Rhythmbox – a sound file player

14 3 INSTALLATION

• LibreOffice Writer

• A briefcase – Ubuntu Software – install new software

• A questio mark – Help

• Amazon

• Software Updater

Click on “Activities” and look over at the right hand side of the screen. Thebrings up Unity’s virtual windows. You can scatter your applications acrossmultiple windows, and move from one to another by clicking on “Activities”.

At the bottom of the left hand screen is a 3 × 3 matrix of dots. This showsyour available applications. You can show a small list of applications yourun frequently, or you can show all of them.

3.10 As Installed Partitioning

I am showing you here how the disk drive got partitioned. There is no needfor you to do this.

The following output was done immediately after installing Linux, Note howI use sudo to get into fdisk. This command can wipe out everything on yourhard drive, so use it with extreme caution. Here, I read the partition table,then I exited without saving anything. I see no reason why an ordinary usershould run fdisk.11

howard@Lenovo:~$ sudo fdisk /dev/sda

[sudo] password for howard:

Welcome to fdisk (util-linux 2.31.1).

Changes will remain in memory only, until you decide to write them.

Be careful before using the write command.

Command (m for help): p

11 If you are in fdisk, Enter the command “q” to quit without saving changes.

3.10 As Installed Partitioning 15

Disk /dev/sda: 149.1 GiB, 160041885696 bytes, 312581808 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: dos

Disk identifier: 0x7783c1d0

Device Boot Start End Sectors Size Id Type

/dev/sda1 * 2048 3905535 3903488 1.9G 83 Linux

/dev/sda2 3905536 82030591 78125056 37.3G 83 Linux

/dev/sda3 82030592 312580095 230549504 110G 83 Linux

Command (m for help): q

howard@Lenovo:~$ df

Filesystem 1K-blocks Used Available Use% Mounted on

udev 1936588 0 1936588 0% /dev

tmpfs 393368 1900 391468 1% /run

/dev/sda2 38186548 7104652 29112388 20% /

tmpfs 1966840 0 1966840 0% /dev/shm

tmpfs 5120 4 5116 1% /run/lock

tmpfs 1966840 0 1966840 0% /sys/fs/cgroup

/dev/loop0 3840 3840 0 100% /snap/gnome-system-monitor/51

/dev/loop2 2432 2432 0 100% /snap/gnome-calculator/180

/dev/loop1 13312 13312 0 100% /snap/gnome-characters/103

/dev/loop4 14848 14848 0 100% /snap/gnome-logs/37

/dev/loop5 89088 89088 0 100% /snap/core/4917

/dev/loop3 144384 144384 0 100% /snap/gnome-3-26-1604/70

/dev/loop6 35584 35584 0 100% /snap/gtk-common-themes/319

/dev/sda1 1888268 147920 1626380 9% /boot

/dev/sda3 112940284 66264 107093900 1% /home

tmpfs 393368 16 393352 1% /run/user/121

tmpfs 393368 32 393336 1% /run/user/1000

/dev/loop7 89984 89984 0 100% /snap/core/5742

/dev/loop8 13312 13312 0 100% /snap/gnome-characters/139

/dev/loop9 2304 2304 0 100% /snap/gnome-calculator/260

/dev/loop10 3840 3840 0 100% /snap/gnome-system-monitor/57

/dev/loop11 14976 14976 0 100% /snap/gnome-logs/45

16 3 INSTALLATION

/dev/loop12 144128 144128 0 100% /snap/gnome-3-26-1604/74

howard@Lenovo:~$

The root partition (/) is 20% full. This leaves room for system logs, and forupgrades to newer, larger Linux installs.

3.11 Firewall

Immediately on booting and logging in, I did some security checks. There isno need for you to do this, but the results are interesting. From my maindesktop, I probed my newly installed Ubuntu system.

[howard@Rev Lenovo]$ ping -c 1 LenovoW

PING LenovoW (192.168.0.108) 56(84) bytes of data.

64 bytes from LenovoW (192.168.0.108): icmp_seq=1 ttl=64 time=3.49 ms

--- LenovoW ping statistics ---

1 packets transmitted, 1 received, 0% packet loss, time 0ms

rtt min/avg/max/mdev = 3.498/3.498/3.498/0.000 ms

[howard@Rev Lenovo]$ ncat LenovoW 22

Ncat: Connection refused.

[howard@Rev Lenovo]$ ncat LenovoW 80

Ncat: Connection refused.

[howard@Rev Lenovo]$

LenovoW is the name of my laptop on wireless. I issued three commands here.The first command was ping, instructed to execute once only. This checkedto see if my machine is on the network. It is! The next two commands werencat, which checked the specified ports on LenovoW. Port 22 is for sshd, thesecure shell daemon. Port 80 is for httpd, the internet web server daemon.The as-installed firewall is working.

On any machine not located behind a firewall, a firewall is absolutely critical.We want to examine the setup.

I cannot find a Firewall icon. I clicked “Activities” at the top left hand ofthe screen. I typed firewall in the “Type to search...” window. I found

3.12 Networking 17

a firewall I can install, cleverly named Firewall. I clicked on it. When the“Firewall” window came up, I clicked [Install]. When it finishes installing,click [Launch].

Under “Zones”, I selected “external”. I went down through Services, Ports,Protocols and Source Ports, and I made sure everything was turned off.The only thing turned on was ssh, the secure remote shell. I turned thisoff.12 Next to “Configuration” at the top, pull down the button and select[Permanent].

3.12 Networking

Ubuntu automatically connects to your Ethernet and WiFi networks.

3.13 Terminal Sessions

Operating system and desktop developers try hard to make adminstrationtasks work from graphic users interfaces (GUIs). The time comes when youmust open a terminal and deal with the command line.

On a Gnome desktop, there are two ways to open a terminal.

1. Hit Alt-Ctrl-F2. A GNU/Linux destop has seven terminals, num-bered from 1 to 7. Typically, terminal 1 is your graphical desktop.Terminals 2 to 7 provide you with command line logins. For most dis-tributions, Alt-Ctrl-F1 gets you back to the graphical window. Makesure you logged out of the terminal.

2. Click on “Activities”. Click on [Show Applications]. Search for aterminal. The terminal may be located under Utilities.

I have written a HOWTO on the UNIX/Linux command line.

12 The secure shell allows you to login remotely to your computer. If you do notunderstand UNIX shells, this feature is useless. My test above indicated that this portwas closed. My guess is that the daemon was not running, which is not surprising, giventhat it is not installed by default.

18 3 INSTALLATION

3.14 New Users

Let’s create some user accounts. You have sudo access. Your new usersprobably should not have this.

Click on “Activities” at the top left of the screen. In the “Type to search...”window, type users. You should see an icon for “Add or remove users andchange your password”. Click on this.

The “Users” window should show of your user account. At the top right ofthe window, you should see an “Unlock” icon. Click on this. Type in yourpassword to get system access.

At the top right, you should be the button [Add User...]. Click on this.

Type in the user name. Type in a password that is strong enough the systemwill accept it. Verify that the account type is [Standard]. Hit [Add] at thetop right of the window.

I have tested it, but I assume that an [Administrator] user has sudo access.

Ubuntu’s default is to leave user accounts readable, but not writable, by theoutside world. This is good. You can set more restrictive permissions on filesand folders. Your email program probably will lock your email account sothat only you, and people with administration access, can read it. Meanwhile,you all can share information.

The user configuration window allows you to attach pictures of your users, oryour users to attach pictures of themselves. This is cute, and it is a securityhole if your machine is exposed to jerks and assholes.

Open a file manager and try reading the folders of other users. These arefound under /home. Ubuntu default behaviour is to allow read access touser folders. This makes sense to me. The other users either are co-workers,friends, or family members. A user can restrict access to folders if necessary.Email tools do this automatically.

3.15 Bluetooth

I tested Bluetooth. Just pull down the network icons at the top right of thescreen, and select Bluetooth. It works!

3.16 Printer 19

3.16 Printer

You probably have one.

If your printer is plugged into your USB, Ubuntu will find it and configureit.13 This takes a while, so be patient. When I set up my Hewlett Packard HPDeskjet 6940, it claimed it was missing drivers. When I launched “Settings”from the left side buttons, I went “Devices”, and “Printer”, and I requesteda test page, everything worked!

1. Click on the [Settings] icon on the left of the screen.

2. Click Devices.

3. Click Printers.

4. The window should indicate at this point that there are no printers.Click [Additional Printer Settings...].14

5. The “Printers – localhost” window comes up. Hit [Add] in the middle.This gives us a selection of places to find a printer.

6. Expand “Network Printer”. You will be prompted for the administratorpassword. This revealed HP Deskjet 6940, my network printer!

7. I clicked on my printer.

8. I left “Connection” at the default HPLIP.

9. I clicked [Forward].

10. The system went searching for drivers. It found some.

11. When the “New Printer” window comes up, I recommend naming itlpr. This is the default Linux printer name, and all sorts of applicationsdefault to it. Hit [Apply].

12. Print a test page. If this works, you are done!

13. Click [Okay].

13 I find that not every USB ports works on this stuff. If the printer is not seen, tryanother USB port.

14 Hitting [Add a Printer...] looks like the right button, but it isn’t.

20 3 INSTALLATION

3.17 More Software

Click on the “Ubuntu Software” icon. Search through this for cool soft-ware packages to install. The GIMP (GNU Image Manipulation Program)is strongly recommend.

3.18 Programming

GNU/Linux is notoriously a good programmer’s environment. This newversion of Ubuntu does not install anything. If you just wanted a desktopfor email, a web browser and office suite, none of this matters.

If you want to develop software, you need this stuff. The original GNU texteditor Emacs is not installed. If you are serious about programming, youwant this. Open a Terminal.

$ sudo apt -y install build-essential emacs

Now, you have gcc, the GNU C compiler, g++, the GNU C++ compiler,and GNU make which builds sofware packages. Lots of other stuff is notinstalled, however, this document is not directed at dedicated programmers.If it matters, you can search for stuff and install it.

3.19 Window Managers

Ubuntu’s standard window manager is Unity, a version of Gnome 3. Thereare other window managers out there that are worth looking at. I don’t likeGnome 3 very much. You may be installing Ubuntu as a way of making anolder, slower machine continue working. Some other window managers aresmaller, faster, and they behave enough like Microsoft Windows that youunderstand what they are doing.

When you login, you will see a little gear next to the [Sign In] button. Clickon this, and you will see a list of desktops. Let’s add some. You will need toreboot to get these onto the login menu.

In all cases, you need to open a terminal.

3.20 Fortune Cookie 21

3.19.1 XFCE

XFCE describes itself as a lightweight window manager.

$ sudo apt -y install xfce4

When you log into this thing, look carefully at the top menu bar. You havefour virtual windows you can click on. This way more convenient than Unity.

3.19.2 LXDE

This is another lightweight window manager.

$ sudo apt -y install lxde

On first login, the virtual windows are at the bottom left of the menu bar.Right click on it. The “Desktop Pager” is configurable.

3.19.3 Other Window Managers

There are other window managers available for Ubuntu. KDE is the otherfancy, heavyweight manager. I run FVWM. You can Google all this stuff ifyou are interested.

3.20 Fortune Cookie

It ain’t *NIX if there is no joke printed at the opening of each commandshell.

If worst comes to worst, this is installable from a command line terminal,such as the Gnome terminal.

22 3 INSTALLATION

Red Hat (Fedora) Debian (Ubuntu)

$ sudo dnf -y install fortune-mod

I activated the fortune cookie byadding the following lines to thevery bottom of /etc/profile

$ sudo nano /etc/profile

FORTUNE=/usr/bin/fortune

if [ -x ${FORTUNE} ]; then

${FORTUNE}

fi

$ sudo apt -y install fortune-mod

I activated the fortune cookie byadding the following lines to thevery bottom of /etc/profile

$ sudo nano /etc/profile

FORTUNE=/usr/games/fortune

if [ -x ${FORTUNE} ]; then

${FORTUNE}

fi

Make sure you scroll all the way to the bottom of /etc/profile beforetyping anything in.

The terminal that is launched by Gnome does not automatically run theFortune Cookie. Pull down the edit menu. Select Preferences. Select Pro-files. You should see highlighted a profile called “Unnamed”. Click the Editbutton. Select Command. Ensure you have highlighted the button “Runcommand as a login shell”.

It will be worth it.

3.21 More Security

On this installation, we do not have an encrypted hard drive. If your machineis a laptop that will be transported outside your home, this is not your in-stallation procedure. If you keep your machine at home behind your firewall,you do not need to do the following. If you are plugged directly into yourDSL or cablem modem without a firewall, you should disable ping.

3.21.1 Disable Ping

Ping is a useful network debugging tool. If your computer sits behind afirewall, you should not disable this. If you are exposed to the externalinternet, you should do this.

23

To do this, we need to edit a configuration file. You must use sudo, and youmust be very, very careful. You need to edit sysctl.conf, scrolling to thevery bottom of the file to add this. . .

$ sudo nano /etc/sysctl.conf

###################################################################

# Disable ping

net.ipv4.icmp_echo_ignore_all=1

A Backups

You need a strategy for backing up your hard drive.

I have had an administered, backed up hard drive since 1996. I was takingsome college courses, and getting involved in a ski club in 1998. My emailsand working files are still on my hard drive, although I used at least onecommercial application I cannot get working at the moment.

The primary threat to my data has been me stupidly deleting things, some-times realizing this months later. My primary hard drive has died on me. Ilost no data.

At present, I have two backup devices on my primary computer, a 4 terabytehard drive, and a Blue-ray burner. My automatic nightly backup is doneto the 4TB drive. Periodically, I copy my latest backup to a double densityBlue-ray disk, which has a capacity of 50GB. These are stored in my house,away from my computer. If I really wanted to be thorough, I could rent asafety deposit box at the bank, and store my backup Blue-rays there.

Optical disks, like Blue-rays, are disappearing off of new computers. I amconcerned that it will become hard to find Blue-ray disks, especially thedouble density ones. I love Blue-rays because the individual disks are cheap,and suitable for single use. I have recovered data months after having deletedit.

The Blue-ray requires me to limit the disk space I use. My biggest directoriesare my digital photo directory, and my email, which is archived at least back

24 B MOUNTING A USB STICK WHILE INSTALLING

to 1997. I archive my digital photos to DVD. I am not intensively doinggraphical design, or engineering CAD.

The Cloud is an excellent resource for temporary sharing of information.As a long-term backup of information with security issues, it is risky. Askyourself why such a service is provided free. Assume that data uploaded toa free server is being scanned. Can you say “data mining”? An NDA15 willbe worthless when the owners of the server go out of business, and the bailiffsells their equipment to the highest bidder .

Consider how you store your backup media at home. If you are concernedabout security, you should store your backups in a locked cabinet or a safe.Once your backup has been transported to another Linux machine, it isaccessible to whoever has that root access.

You can encrypt your backups, but this makes it more difficult to do recov-eries. I try to avoid compressing my backups, because this takes time, andit can introduce data errors.

I may have to switch to portable USB drives. Tape drives still are available,and they have huge capacity. The tapes do not appear to be particularlycheap.

B Mounting a USB Stick While Installing

Maybe you will need to do this.

I was having some problems with an install, and I decided to mount myUSB stick. During the install routine, this is fairly easy. Hit ctrl+alt+f4.Log in as root. You should not need a password. Insert your USB stick. Youwill see a gibberish message on the screen with something like /dev/sdb.This is your USB device. You need to create a file system as a mount point,then mount your stick.

# mdkir /usb

# mount /dev/sdb1 -o auto /usb

15 Non Disclosure Agreement

25

The mount command, above, specifies the device. Note that it is /dev/sdb1,not /dev/sdb. The -o auto tells Fedora to figure out the file system type.You could specify vfat, which probably is what it is, but why?

Now, you can copy files, or back up data. See my article on the UNIXCommand Line.

Now, you need to get back to your installation window. On Fedora andUbuntu, ctrl+alt+f1 should do it. Anything up to ctrl+alt+f7 will pro-duce a terminal.