Basic Orientation to Linux
Compilation of Slides used in course
Basic Orientation to Linux
Conducted in February 2016
Vidyaratha Kissoon
Email vidyak1@gmail.com
Distributed under
Creative Commons Attribution-ShareAlike 4.0
.
(Evolved from an outline prepared by
Andrew Mancey )
By the end of the orientation..
Participation should be able to
explain free and open source software (FOSS),
and explore options
select and install any distribution of Linux
recommend various free and open source
software options to people who are interested
explore some of the system management issues
related to the Linux operating system
Know how to find answers to questions about
Free and Open Source Software including Linux
Methodology

Presentations, hands on practice
– Computers needed, network infrastructure

Responsive to needs of participants

Multiple sessions, with about 90 to 120
minutes per session depending on
participant needs

Interactive

Participant evaluation at the end of the
course
Topics
Free and Open Source Software
Linux
Installation of distros
Drivers
Navigating the Linux the File System
– File permissions
Managing Users
Adding software
Networking – SSH, Samba (Finding help )
WINE
Definition of FOSS

Free Software Movement
− The freedom to run a program, for any purpose;
− The freedom to study how a program works and
adapt it to a person’s needs. Access to the source
code is a precondition for this;
− The freedom to redistribute copies so that you can
help your neighbour; and
− The freedom to improve a program and release your
improvements to the public, so that the whole
community benefits. Access to the source code is a
precondition for this
− libre vs gratuit

Richard Stallman is the founder
Definition of FOSS..

Free redistribution

Source code

Derived works

Integrity of author's code

No discrimination against
users

No discrimination against
fields of endeavour

Distribution of license

License must be
technology-neutral

License must not be
specific to a product

License must not restrict
other software

Managed be Open Source
Initiative, focussed on
technical issues
Types of FOSS

Operating Systems - Linux, FreeBSD

Databases - MySql, PostgreSQL

Webservers – Apache, Nginx, Lighthttpd,

CMS – Drupal, Joomla

Elearning – Moodle, Claronline

Graphics – GIMP, Blender, Inkscape

Internet Apps – Firefox, Opera, Ekiga

Multimedia – VLC, Mplayer,

Productivity – Libre Office, Open Office, GnuCalc, Abiword

GIS – QGIS, GRASS,

and hundreds of others – some on Other Operating Systems
Why bother with FOSS?

Security

Reliability/Stability

Open standards and vendor
independence

Reduced reliance on imports

Developing local software capacity

Piracy, IPR, and WTO

Localization
Why bother with FOSS..

But..
− lack of business applications
− interoperability with proprietary systems
− limited documentation and 'polish'
− Learning curve
What is Linux

Linux the kernel
− Linux was originally the name of the kernel created by
Linus Torvalds and is currently maintained by a team
of developers.

Linux – the distributions
− the kernel, plus the system libraries, GUI, various
databases, web servers, email utilities, desktop
software and others.
− Debian, Ubuntu, CentOS, Red Hat, SUSE/open Suse
DamnSmallLinux, Tiny Core Linux, Linux Mint – some
free, some not so free
− Different Distros available for different kinds of devices
− Not all applications are “FOSS” (eg skype ),
Kernel, Shell
Linux OS
- everything is a file, or process (or socket)
- e.g. printing – is writing to a 'device file'
- documents, executable scripts, directories
- kernel, shell
- Inodes
Inodes
Before Installation..

Assessing Current System

RAM, space, graphic cards, etc

Distribution selection

Depends on needs

Desktop vs Server use

Variety to chose from

System Preparation

Dual boot , Partition hard drives

Installation media (Live CD, StartupUSB)
Drivers...
• Safely, most vendors are providing
drivers which could work with Linux
– Example Printer drivers
• “Nvidia still offers the worst open-source
support, compared to Intel and AMD”
http://www.pcworld.com/article/2911459/why
• Drivers are available, but 'closed source'
Partition
One partition for Root file system
Swap partition (like extra virtual memory)
Partition for user files
Do the installation
File system
Linux Directory structure
http://www.tecmint.com/linux-directory-structure-and-important-files-paths-explained/
File system
/bin Common programs, shared by the system, the system administrator and
the users.
/boot The startup files and the kernel, vmlinuz. In some recent distributions
also grub data. Grub is the GRand Unified Boot loader and is an attempt to
get rid of the many different boot-loaders we know today.
/devContains references to all the CPU peripheral hardware, which are
represented as files with special properties.
/etc Most important system configuration files are in /etc, this directory
contains data similar to those in the Control Panel in Windows
File system
/homeHome directories of the common users.
/initrd (on some distributions) Information for booting. Do not remove!
/lib Library files, includes files for all kinds of programs needed by the
system and the users.
/lost+found Every partition has a lost+found in its upper directory. Files
that were saved during failures are here.
/misc For miscellaneous purposes.
/mnt Standard mount point for external file systems, e.g. a CD-ROM or a
digital camera.
/net Standard mount point for entire remote file systems
/opt Typically contains extra and third party software.
/proc A virtual file system containing information about system resources.
More information about the meaning of the files in proc is obtained by
entering the command man proc in a terminal window. The file proc.txt
discusses the virtual file system in detail.
File system
/root The administrative user's home directory. Mind the difference
between /, the root directory and /root, the home directory of the root user.
/sbin Programs for use by the system and the system administrator.
/tmp Temporary space for use by the system, cleaned upon reboot, so don't
use this for saving any work!
/usr Programs, libraries, documentation etc. for all user-related programs.
/var Storage for all variable files and temporary files created by users, such as
log files, the mail queue, the print spooler area, space for temporary storage
of files downloaded from the Internet, or to keep an image of a CD before
burning it.
Commands
Open Terminal Window
(tab completion )
Type ls
Ls -a
Ls -l
Cd
mkdir
Attributes(https://www.ntu.edu.sg/home/ehchua/programming/howto/Unix_Basics.html)
File permissions
owner - The Owner permissions apply only the
owner of the file or directory, they will not
impact the actions of other users.
group - The Group permissions apply only to the
group that has been assigned to the file or
directory, they will not effect the actions of
other users.
all users - The All Users permissions apply to all
other users on the system, this is the
permission group that you want to watch the
mos
Permission types
Each file or directory has three basic permission types:
read - The Read permission refers to a user's capability
to read the contents of the file.
write - The Write permissions refer to a user's capability
to write or modify a file or directory.
execute - The Execute permission affects a user's
capability to execute a file or view the contents of a
directory.
File permission ls -l
Binary number system
U g o
rwx | r-x | r-- |
111 101 100
7 5 4
Permission is described as 754
Changing permissions
chmod command
– changing permissions
let's create some files
– touch mango.txt
– touch pear.txt
Binary arithmetic
chmod ug+x pear.txt
Chmod 777 mango.txt
Chmod ugo-w mango.txt
Adding groups and users
(all lower case )
- super user/root
- other users
- process users
“Sudo adduser john”
Check /etc/passwd
sudo addgroup <groupname>
adduser <username> <groupname>
Changing passwords
Passwd
sudo passwd <username>
sudo passwd -l/u <username>
Deluser <username>
Adding software
Software repositories
Distribution host
Software creators (original websites)
Third Party repositories (ppa) Trusted
sources!!!
GitHub, other places
Compiling from Source
Managing RPM, deb packages
Downloading

Download .deb package

Download source code
− Tarball (tar, and then zipped gz, bz, )
− tar -zxvf <filename>.tar.gz
− -z to tell tar to run this file through gzip to decompress (use -j for bzip files)
− -x to extract the files
− -v for “verbose”, so we can see a list of the files it’s extracting
− -f to tell tar that we’re working with a file

Or “Check out” source code
− ./configure
− make to create 'Makefile'
− Make install
− Run sample files
Package managers
Advanced Packaging Tool (on debian), yum
on Red Hat, etc
Apt has a local package database, yum
does not
Sudo apt-get install …
Let us try installing
Vlc. Inkscape
Pdfsam
Compiling source
sudo apt-get install build-essential
Example : Pdfsandwich – from source
Download source tarball
Extract
./configure
Make
Make install
Network GUI

Desktop

Network tools, Edit Network Connections

Command “ifconfig “
SSH
Secure shell access
Set up a server
Clients then 'ssh' into the server over the network
sudo apt-get install openssh-server
Edit “/etc/ssh/sshd_config
“sudo restart ssh “ or “sudo systemctl restart ssh”
From client : ssh <remote_username>@<host>
Use PUTTY as a client
Samba – File sharing
Install the samba server
Install
Configure it
Create the shared folders
Mapping drives, Mount the drives
Printer sharing
Wine

Compatibility layer (not an emulator)

Many .exe files, there might be some
performance issues

Some games, etc, (Steam)

Basic orientation to Linux

  • 1.
  • 2.
    Compilation of Slidesused in course Basic Orientation to Linux Conducted in February 2016 Vidyaratha Kissoon Email vidyak1@gmail.com Distributed under Creative Commons Attribution-ShareAlike 4.0 . (Evolved from an outline prepared by Andrew Mancey )
  • 3.
    By the endof the orientation.. Participation should be able to explain free and open source software (FOSS), and explore options select and install any distribution of Linux recommend various free and open source software options to people who are interested explore some of the system management issues related to the Linux operating system Know how to find answers to questions about Free and Open Source Software including Linux
  • 4.
    Methodology  Presentations, hands onpractice – Computers needed, network infrastructure  Responsive to needs of participants  Multiple sessions, with about 90 to 120 minutes per session depending on participant needs  Interactive  Participant evaluation at the end of the course
  • 5.
    Topics Free and OpenSource Software Linux Installation of distros Drivers Navigating the Linux the File System – File permissions Managing Users Adding software Networking – SSH, Samba (Finding help ) WINE
  • 6.
    Definition of FOSS  FreeSoftware Movement − The freedom to run a program, for any purpose; − The freedom to study how a program works and adapt it to a person’s needs. Access to the source code is a precondition for this; − The freedom to redistribute copies so that you can help your neighbour; and − The freedom to improve a program and release your improvements to the public, so that the whole community benefits. Access to the source code is a precondition for this − libre vs gratuit  Richard Stallman is the founder
  • 7.
    Definition of FOSS..  Freeredistribution  Source code  Derived works  Integrity of author's code  No discrimination against users  No discrimination against fields of endeavour  Distribution of license  License must be technology-neutral  License must not be specific to a product  License must not restrict other software  Managed be Open Source Initiative, focussed on technical issues
  • 8.
    Types of FOSS  OperatingSystems - Linux, FreeBSD  Databases - MySql, PostgreSQL  Webservers – Apache, Nginx, Lighthttpd,  CMS – Drupal, Joomla  Elearning – Moodle, Claronline  Graphics – GIMP, Blender, Inkscape  Internet Apps – Firefox, Opera, Ekiga  Multimedia – VLC, Mplayer,  Productivity – Libre Office, Open Office, GnuCalc, Abiword  GIS – QGIS, GRASS,  and hundreds of others – some on Other Operating Systems
  • 9.
    Why bother withFOSS?  Security  Reliability/Stability  Open standards and vendor independence  Reduced reliance on imports  Developing local software capacity  Piracy, IPR, and WTO  Localization
  • 10.
    Why bother withFOSS..  But.. − lack of business applications − interoperability with proprietary systems − limited documentation and 'polish' − Learning curve
  • 11.
    What is Linux  Linuxthe kernel − Linux was originally the name of the kernel created by Linus Torvalds and is currently maintained by a team of developers.  Linux – the distributions − the kernel, plus the system libraries, GUI, various databases, web servers, email utilities, desktop software and others. − Debian, Ubuntu, CentOS, Red Hat, SUSE/open Suse DamnSmallLinux, Tiny Core Linux, Linux Mint – some free, some not so free − Different Distros available for different kinds of devices − Not all applications are “FOSS” (eg skype ),
  • 12.
  • 13.
    Linux OS - everythingis a file, or process (or socket) - e.g. printing – is writing to a 'device file' - documents, executable scripts, directories - kernel, shell - Inodes
  • 14.
  • 15.
    Before Installation..  Assessing CurrentSystem  RAM, space, graphic cards, etc  Distribution selection  Depends on needs  Desktop vs Server use  Variety to chose from  System Preparation  Dual boot , Partition hard drives  Installation media (Live CD, StartupUSB)
  • 16.
    Drivers... • Safely, mostvendors are providing drivers which could work with Linux – Example Printer drivers • “Nvidia still offers the worst open-source support, compared to Intel and AMD” http://www.pcworld.com/article/2911459/why • Drivers are available, but 'closed source'
  • 17.
    Partition One partition forRoot file system Swap partition (like extra virtual memory) Partition for user files Do the installation
  • 18.
  • 19.
  • 20.
    File system /bin Commonprograms, shared by the system, the system administrator and the users. /boot The startup files and the kernel, vmlinuz. In some recent distributions also grub data. Grub is the GRand Unified Boot loader and is an attempt to get rid of the many different boot-loaders we know today. /devContains references to all the CPU peripheral hardware, which are represented as files with special properties. /etc Most important system configuration files are in /etc, this directory contains data similar to those in the Control Panel in Windows
  • 21.
    File system /homeHome directoriesof the common users. /initrd (on some distributions) Information for booting. Do not remove! /lib Library files, includes files for all kinds of programs needed by the system and the users. /lost+found Every partition has a lost+found in its upper directory. Files that were saved during failures are here. /misc For miscellaneous purposes. /mnt Standard mount point for external file systems, e.g. a CD-ROM or a digital camera. /net Standard mount point for entire remote file systems /opt Typically contains extra and third party software. /proc A virtual file system containing information about system resources. More information about the meaning of the files in proc is obtained by entering the command man proc in a terminal window. The file proc.txt discusses the virtual file system in detail.
  • 22.
    File system /root Theadministrative user's home directory. Mind the difference between /, the root directory and /root, the home directory of the root user. /sbin Programs for use by the system and the system administrator. /tmp Temporary space for use by the system, cleaned upon reboot, so don't use this for saving any work! /usr Programs, libraries, documentation etc. for all user-related programs. /var Storage for all variable files and temporary files created by users, such as log files, the mail queue, the print spooler area, space for temporary storage of files downloaded from the Internet, or to keep an image of a CD before burning it.
  • 23.
    Commands Open Terminal Window (tabcompletion ) Type ls Ls -a Ls -l Cd mkdir
  • 24.
  • 25.
    File permissions owner -The Owner permissions apply only the owner of the file or directory, they will not impact the actions of other users. group - The Group permissions apply only to the group that has been assigned to the file or directory, they will not effect the actions of other users. all users - The All Users permissions apply to all other users on the system, this is the permission group that you want to watch the mos
  • 26.
    Permission types Each fileor directory has three basic permission types: read - The Read permission refers to a user's capability to read the contents of the file. write - The Write permissions refer to a user's capability to write or modify a file or directory. execute - The Execute permission affects a user's capability to execute a file or view the contents of a directory.
  • 27.
  • 28.
    Binary number system Ug o rwx | r-x | r-- | 111 101 100 7 5 4 Permission is described as 754
  • 29.
    Changing permissions chmod command –changing permissions let's create some files – touch mango.txt – touch pear.txt Binary arithmetic chmod ug+x pear.txt Chmod 777 mango.txt Chmod ugo-w mango.txt
  • 30.
    Adding groups andusers (all lower case ) - super user/root - other users - process users “Sudo adduser john” Check /etc/passwd sudo addgroup <groupname> adduser <username> <groupname>
  • 31.
    Changing passwords Passwd sudo passwd<username> sudo passwd -l/u <username> Deluser <username>
  • 32.
    Adding software Software repositories Distributionhost Software creators (original websites) Third Party repositories (ppa) Trusted sources!!! GitHub, other places Compiling from Source Managing RPM, deb packages
  • 33.
    Downloading  Download .deb package  Downloadsource code − Tarball (tar, and then zipped gz, bz, ) − tar -zxvf <filename>.tar.gz − -z to tell tar to run this file through gzip to decompress (use -j for bzip files) − -x to extract the files − -v for “verbose”, so we can see a list of the files it’s extracting − -f to tell tar that we’re working with a file  Or “Check out” source code − ./configure − make to create 'Makefile' − Make install − Run sample files
  • 34.
    Package managers Advanced PackagingTool (on debian), yum on Red Hat, etc Apt has a local package database, yum does not Sudo apt-get install … Let us try installing Vlc. Inkscape Pdfsam
  • 35.
    Compiling source sudo apt-getinstall build-essential Example : Pdfsandwich – from source Download source tarball Extract ./configure Make Make install
  • 37.
    Network GUI  Desktop  Network tools,Edit Network Connections  Command “ifconfig “
  • 38.
    SSH Secure shell access Setup a server Clients then 'ssh' into the server over the network sudo apt-get install openssh-server Edit “/etc/ssh/sshd_config “sudo restart ssh “ or “sudo systemctl restart ssh” From client : ssh <remote_username>@<host> Use PUTTY as a client
  • 39.
    Samba – Filesharing Install the samba server Install Configure it Create the shared folders Mapping drives, Mount the drives Printer sharing
  • 40.
    Wine  Compatibility layer (notan emulator)  Many .exe files, there might be some performance issues  Some games, etc, (Steam)

Editor's Notes

  • #3 This orientation course was conducted during February 2016. The Participants were employees of STARR Computers, one of Guyana&amp;apos;s oldest technology product providers.