Sunday, August 20, 2017

Week 7: Iptables Firewall Configuration

Image 1

INTRODUCTION

This week there was a need to setup and manipulate the iptables. One of the first steps before starting is to disable the firewall as seen in image 1.



INSTALL

Image 2
As in all weeks prior must install iptables and firewall system config tool. This can be completed by using the following commands for iptables #yum -y install iptables-services and #rpm -q iptables. Next, firewall tool use #yum -y install system-config-firewall command. After which need to setup and restart the system. Lastly check the status to ensure it is active. See image 2.

Image 3

MANIPULATE IPTABLE

Once this is installed and status is confirmed can manipulate the table to decide access and security settings. Such as disabling telnet connections. One such command is to remove/delete certain lines. First lets check what the iptables currently appear using the command line #iptables --line-numbers -n -L in image 3.

Image 4

Next can use #iptables -D INPUT 4 command where the -D (delete) removes the 4th line changes can be seen in image 4.
Some other basic commands include the following:
-F : Deleting (flushing) all the rules.
-X : Delete chain.
-t table_name : Select table (called nat or mangle) and delete/flush rules.
-P : Set the default policy (such as DROP, REJECT, or ACCEPT).


CONCLUSION
It is important to have a good firewall setup to increase security and this is done through iptables on Linux. Above is just some basics but it puts a person on the right path to computer security.
















Sunday, August 13, 2017

Week 6: DataBase Use Linux/Fedora

INTRODUCTION
This week is to use and create a simple database in Linux. First for those who have used or have knowledge MySQL language this will be very familiar. Here will not make you an expert but will show how to ensure the program is available and create and view a simple database.


Image 1

SETTING UP
Image 2
Must first check to see if the database is loaded. On the this system using MariaDB. Mention this should any issues arise can go the following link for more information https://mariadb.org/.






In image1 (above) shows the results of the command rpm -qa | grep mariadb which ensures program exists. Next, image2 checks to make sure that the database is active using systemctl status mysqld






Image 3




 CREATING DATABASE
First need to access the database using the command mysql -u root -p image3 shows the result of the command. Notice [none] next to the mariadb this shows that you are not in an active database.



Now can create the first database. The command is the similar to what is used in MySQL. The CREATE DATABASE command and name of the database in this case JohnDB. It is important to remember to use semicolons at the end of the command lines. Example in  image4 below can see command and using the USE command to enter the newly created database. Here note that the [none] has changed to the new database.
Image 4
CREATING TABLE
In image 5 can see all the commands and entering data into the table.
Image 5

DISPLAY TABLE
In image6 can see the results of the table created in the database. Note that used SELECT * FROM command to see all data in the Employees table.
Image 6
CONCLUSION
This week installed, created a database and displayed a table from the database. Knowing the basic commands from MySQL would be very helpful in working in this system.






.

Sunday, August 6, 2017

Week 5: Setup Web Server

INTRODUCTION
This week there was a need to setup the web server. The reason to setup the server is to give the flexibility to include coordinating information flow between remote clients and local databases, interpreting scripts and streaming videos.

SETTING UP
The choice here is to use the Apache web server. One of the first steps is to turn of the firewall and iptables using the commands #systemctl stop firewalld/#systemctl stop iptables. The reason being that during this week not concerned with setting up security during server setup. After use the command #yum –y install httpd to install Apache. In image 1 use shows the results of the command #rpm -qa grep| http.
Image 1










Next step is to use the #systemctl start http commands to start the server. Following checks the status with #systemctl status http see image 2. Last is to enable the server with #systemctl enable http. Provided all steps are were followed the server is ready.

Image 2

TEXT BROWSER
Installing a text browser called links using the command #yum -y install links. After which can setup simple text pages to view using a text editor such as nano. Note that when using the text editor, unlike in previous weeks, some html language is needed such as below:

<html><body>

Apache is cool!!!

This message is from your_name_here.

</body></html>

Notice that the terms placed in the "< >" is the opening of the html language and the "</ > closes the html formatting. This is covered in other blogs/classes.

CONCLUSION
Unlike previous weeks this should be quick an easy even for a beginner. Would encourage even a beginner to get in there and try and use the terminal and text editors to unlock the potential of the Linux language.



Sunday, July 30, 2017

Week 4: vsFTP Using Nano

INTRODUCTION
This week involved setting up the vsFTP which is used for moving files from the client to the server. During the setup and previous weeks have noted it is important to know how to utilize manipulating files in Linux. So this week will discuss nano just one of the text editors to choose from.


Image 1




NANO TIPS
First is to open a file is to place nano <filepath>. In image 1 can see this command line being used to open /etc/vsftpd/vsftpd.conf.




Image 2


The next thing to notice is at the bottom of the nano editor as seen in image 2. You can view the commands listing. Note to call the commands the user can hit ctrl (letter) to do assorted things within the editor. Just some of these commands are saving/writeout with ctrl c. Another useful keyboard command is ctrl g which brings up the help menu.





A command of note is to hit ctrl c to see your current line number. However, would recommend hitting alt c which leaves the line number on the screen to show current position. This helps to know exactly where you are in the file see image 3. Lastly if you know the line number and you wish to change can get there quickly using alt g to enter the number.
Image 3















CONCLUSION
There are other choices when it comes to file manipulation such as vi and gedit both should also be looked at to decide what works best for the user. However, nano should be in the arsenal of all linux users as a fall back. Here is a great link below. It is a list of the commands/keyboard shortcuts within nano.

Sunday, July 23, 2017

Week 3: Send-mail Setup


INTRODUCTION:
This week needed to set up send-mail server. Like weeks prior it is important to pay close attention to the instructions and spelling/typos/spacing. In last blog had issues and noted that very fact. Another thing to note was to use the “cd” command to change directories more often to see where you are working versus using the whole directory path/ Example go from cd /var/spool/mail would now show that you are working in the mail folder. In comparison to typing that over and over again to make changes in the mail directory/folder.

IMAGE 1 (gedit)



NEW ITEMS:
Something new for this week was to use gedit see image 1 left versus using nano see image 2 below. The gedit gives a quick save button and other selections versus using ctrl “letter” choices to complete tasks.

IMAGE 2 (nano)











IMAGE 3
LAB 3 
Similar to weeks prior still had trouble shooting issues. The main issue was getting the #systemctl start sendmail.service and #systemctl status sendmail.service to display the example given in the lab. See image 3.

After looking on discussion board found that using restart versus start cured that problem. The final issue turned out to be that the users created could not get permission to view the mail being sent. Could see in the journalctl -xn command that the mail was sent just could not get the permissions to let the second user view the mail.
One suggestion was to use adduser <user> mail command and following after run chmod ug+rw /var/mail/<user>. This also gave no good results. 

CONCLUSION
Conclusion was still having problems in Skillsoft lab but if keep practicing it can only get better. So would recommend to all not matter how bad it gets keep on trying and learn from the errors.



Sunday, July 16, 2017

Week 2: DNS Server Lab

Image 1
INTRODUCTION:

There are some differences in the working of the labs from what is supplied and what is required. The purpose of the blog this week is to assist in making it through the lab. NOTE: some errors may occur if spacing or spelling errors occur. In addition, should you get the clock screen saver click ctrl-v and will return to the work screen. See Image 1.



Image 2





First need to log onto the TigerVNC viewer, click connect and use the password provided. See Image 2.
Image 3








The next few steps should begin to look familiar from week one and other exercises. On the screen click Activities and search for terminal in the navigation bar. See Image 3.

From here on need to follow the instructions that are given on the side of the Skillsoft screen.






ADDITIONAL TIPS
Watch for spacing/spelling of the inputs.
Ensure to switch users from student to root using the “su root” command.
Ensure you have the spacing and commands spelled correctly by using Notepad beside the lab. See Images 4 and 5.

Image 4

Image 5




































CONCLUSION
Despite following the instructions still gave errors. Could not seem to find the issue "Some lines were ellipsized use -l to show in full".
All images from 6-9 are the attempts to locate the flaw/error.
Image 6

Image 7

Image 8

Image 9



Saturday, July 8, 2017

Week 1: Basic Linux Commands

Figure 1: putty
THE BEGINNING

The ability to learn any language always starts with the basics. In Linux that means setting down the path through the command window similar to DOS. However, utilizing a Fedora workstation rather than the command window of old. Seen in Figure 1.






THE BASIC COMMANDS

Just some of the basic commands are:

Command                                                 Description
ls                              List the contents of the current directory in short form.
-a                              Added to ls will display hidden files
pwd                              Prints the working directory
cp                              Copies files
rm                              Remove files
cd                              Change directories
mkdir                      Creates a new directory
rmdir                      Remove Directory


COMMON ERRORS
Note that there are many ways that errors can occur in comparison to say C# and Java. In these languages you can notice minor errors such as spelling or spacing. In Linux it is more nuanced and need to pay attention to these errors or can get errors as seen in Figure 2. Here got ahead of the programming and forgot to create the file/directory before calling it.
Figure 2


CONCLUSION
In week one are introduced to the Linux formatting and language. From here will build and learn to enhance the ability of using this powerful language and open-source operating system. As the old saying goes a person needs to learn to crawl before you can walk and walk before you can run.