BLUG December 15th Meeting Report

At our meeting of December 15th, we were joined by an IT class at Steven Henager, all the seats in the room were filled!  And we had plenty of Pizza to go around, with thanks to our host Taos.  Clint Tinsley was to start off the meeting with some very basic command line techniques including command line navigation and keyboard shortcuts but the addition of students from Steven Henager, he started off with a tour of the basic desktop based on Mate, a classic desktop based on Gnome2. He then showed how to access a terminal session, first from the right click on the desktop as using the control+alt+F1 (through F6) keys to access the virtual console screens and finally control+alt+F7 that returns to the Graphical Desktop, if it is running.  The virtual console screens are typical of what you would see on Linux server as well as other operating systems that don't have a graphical desktop.

Then opening a terminal session from the desktop menu, he showed the difference between a regular user login and the root or superuser prompts, a regular user typically getting a dollar sign ($) at the end of the prompt and the pound sign (#) which indicates that the user is running with elevated "root" system administration privileges that are potentially destructive if there is an error made with commands.   He also mentioned several times during the evening, that users should always login as their regular users and then only “privileged” or administrative users should use the “sudo” or superuser do to run a command with elevated or root privileges.  (Note: all commands will be shown in  double quotes but are typed at the command line without the quote marks)  One should never login or connect to a system as root because the identity of root user is generally unknown.  Many distributions enforce this by having a root user password enabled such that the root account cannot be used for logging into the system, Ubuntu being in that class of distributions where you cannot login as root.  Another reason for using the “sudo” command is that all “sudo” commands are logged.  On Ubuntu, that log file is /var/log/auth.log.  Clint showed the contents of that file to the group including how to analyze it.  On other system, it could be named secure or something else of a authentication nature.  More information on system logging can be found the /etc/rsyscon.conf and /etc/rsyslog.d configuration files which Clint briefly showed.

Next up was accessing a removal device such as thumb drive which was borrowed from one of the meeting attendees.  Clint inserted the device into the computer so that it could  be automatically recognized at which time, using the “df -h” command which displayed the mounted devices on the system: (list has been shortened to only show the relevant mounted devices)

tinslecl@clint2t:~/Desktop$ df -h
Filesystem      Size   Used Avail Use% Mounted on
tmpfs               395M  6.3M  388M     2% /run
/dev/dm-0       455G  8.2G  423G     2% /
/dev/sda1       236M  144M   80M    65% /boot
/dev/sdb1         15G   12G  3.5G      77% /media/tinslecl/MYLINUXLIVE/KNOPPIX

Clint then started to get into the command line usage by first changing into the thumb drive through the use of the “cd” command.

cd /media/tinslecl/MYLINUXLIVE/KNOPPIX/

In the process he also showed how using the tab key, the system would automatically complete the path saving typing errors.  Example was that by typing “cd /me” and then pressing the tab key, it could complete the media/ path for him and then typing “tin”, it would complete the tinslecl/ part of the path such that on the screen was shown “cd /media/tinslecl/” and then he would go on using “MY” and  an“KN” to complete the full path shown above in the cd command.

The then used the “pwd” command to show the current or working directory that he had “cd” into:

$: pwd

/media/tinslecl/MYLINUXLIVE/KNOPPIX/

He then listed the contents of the folder using the “ls” command and found a file he could use for demonstration:

$: ls

knoppix-cheatcodes.txt

Clint then copied the file to his home directory Documents folder with the “cp” command:

cp knoppix-cheatcodes.txt /home/tinslecl/Documents/

Then he simply typed “cd” which by default will take the user to the user's home directory he then talked about absolute and relative paths, first by using the “pwd” command, it showed the current directory to be /home/tinslecl, an absolute path.  Another “ls” command he showed the directory listing which included the Documents directory and taking advantage of relative paths, all he had to do was type “cd Documents” and he was inside that directory where he could “ls” and see the  knoppix-cheatcodes.txt file.  Finishing this up, he then type “pwd' to show the absolute path of the directory as /home/tinslecl/Documents and to access the file using the “cat” command to display the contents of that file using the absolute path, he type “cat /home/tinslecl/Documents/knoppix-cheatcodes.txt, and then using the relative path to the file, he typed “cat knoppix-cheatcodes.txt”, both producing the same results on the screen.  He stressed that absolute paths will always begin with a forward slash (/) were relative paths starts from the directory you are in, hence relative, never a leading slash!

He then talked about the options of a command, still focusing on the “ls” command which has several options for listing directory contents:

ls -[options]    <= displays directory content listing
                        a    all, include hidden . folders
                        l    long listing, permission, ownership
                        R    Recursion
                        t    use time stamps
                        r    reverse sort, oldest first

Then using the “ls -ltrR”, he recursively listed out all the folders and files in one directory in time order sequence, newest directories and files last being displayed.

He also commented on the use of the “cd” command:

cd, cd ~    <= changes to home directory
cd -        <= returns you to previous directory (toggles)
cd ..         <= takes you up one directory in tree

The most of the rest of the evening, he demonstrated the following command and their various uses:

Copy file                      cp
Move file                      mv
Remove file                  rm
Create directory           mkdir
                                        mkdir -p  /path/path/path
                                        (creates the complete path if it doesn    't exist)
Copy directory             cp -r directory destination_directory
Move directory             mv directory newdirectory_name
Remove directory        rm -rf directory
                                      (force directory removal and contents)
create an empty file: touch <filename>

As part of the demonstration, he also showed how both the copy and move commands can be use to rename a file or directory at the same time, on the fly as so to speak.

He also demonstrated the use of the file command to identify types of names such as a directory, a text file, and a binary file.  In the same demonstration, he also showed using the “wc” command to display the number of lines in a directory:

wc -l /directory or directory /path/path/directory (absolute)

Two other options, the -w and -c, can be used to display the number of words and character count of a file contents respectively.

Clint's presentation took almost a full two hours of the meeting time at which time the meeting was opened for any discussion.

At the close of the meeting, we discussed future topics of interest which included a demonstration of penetration tools such as Kali Linux, and backup tools as well as an update on the Rasberry Pi. One fo the members was going to check with a co-worker to see if he would be willing to talk about Kali at a future meeting.  Our next meeting will be on January 19, 2016.  In closing the meeting, Clint wished everyone pressed the Best of the Holidays and Merry Christmas.  We had some left-over pizza and cookies and the attendees were invited to take some home with them.