40
Basic Orientation to Linux

Basic orientation to Linux

Embed Size (px)

Citation preview

Page 1: Basic orientation to Linux

Basic Orientation to Linux

Page 2: Basic orientation to Linux

Compilation of Slides used in courseBasic Orientation to Linux

Conducted in February 2016Vidyaratha Kissoon

Email [email protected]

Distributed under Creative Commons Attribution-ShareAlike 4.0 International License

.(Evolved from an outline prepared by

Andrew Mancey )

Page 3: Basic orientation to Linux

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

Page 4: Basic orientation to 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

Page 5: Basic orientation to Linux

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

Page 6: Basic orientation to Linux

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

Page 7: Basic orientation to Linux

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

Page 8: Basic orientation to Linux

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

Page 9: Basic orientation to Linux

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

Page 10: Basic orientation to Linux

Why bother with FOSS..

But..− lack of business applications− interoperability with proprietary systems− limited documentation and 'polish'− Learning curve

Page 11: Basic orientation to Linux

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 ),

Page 12: Basic orientation to Linux

Kernel, Shell

Page 13: Basic orientation to Linux

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

Page 14: Basic orientation to Linux

Inodes

Page 15: Basic orientation to Linux

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)

Page 16: Basic orientation to Linux

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-nvidia-graphics-cards-are-the-worst-for-open-source-but-the-best-for-linux-gaming.html

• Drivers are available, but 'closed source'

Page 17: Basic orientation to Linux

Partition

One partition for Root file system

Swap partition (like extra virtual memory)

Partition for user files

Do the installation

Page 18: Basic orientation to Linux

File system

Page 19: Basic orientation to Linux

Linux Directory structure

http://www.tecmint.com/linux-directory-structure-and-important-files-paths-explained/

Page 20: Basic orientation to Linux

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

Page 21: Basic orientation to Linux

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.

Page 22: Basic orientation to Linux

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.

Page 23: Basic orientation to Linux

Commands

Open Terminal Window

(tab completion )

Type ls

Ls -a

Ls -l

Cd

mkdir

Page 24: Basic orientation to Linux

Attributes(https://www.ntu.edu.sg/home/ehchua/programming/howto/Unix_Basics.html)

Page 25: Basic orientation to Linux

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

Page 26: Basic orientation to Linux

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.

Page 27: Basic orientation to Linux

File permission ls -l

Page 28: Basic orientation to Linux

Binary number system

U g o

rwx | r-x | r-- |

111 101 100

7 5 4

Permission is described as 754

Page 29: Basic orientation to Linux

Changing permissionschmod command

– changing permissions

let's create some files

– touch mango.txt

– touch pear.txtBinary arithmetic

chmod ug+x pear.txtChmod 777 mango.txtChmod ugo-w mango.txt

Page 30: Basic orientation to Linux

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>

Page 31: Basic orientation to Linux

Changing passwords

Passwd

sudo passwd <username>

sudo passwd -l/u <username>

Deluser <username>

Page 32: Basic orientation to Linux

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

Page 33: Basic orientation to Linux

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

Page 34: Basic orientation to Linux

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

Page 35: Basic orientation to Linux

Compiling source

sudo apt-get install build-essential

Example : Pdfsandwich – from source

Download source tarball

Extract

./configure

Make

Make install

Page 36: Basic orientation to Linux
Page 37: Basic orientation to Linux

Network GUI

Desktop Network tools, Edit Network Connections Command “ifconfig “

Page 38: Basic orientation to Linux

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

Page 39: Basic orientation to Linux

Samba – File sharing

Install the samba server

Install

Configure it

Create the shared folders

Mapping drives, Mount the drives

Printer sharing

Page 40: Basic orientation to Linux

Wine

Compatibility layer (not an emulator) Many .exe files, there might be some

performance issues Some games, etc, (Steam)