Linux - The Path Forward - Creating a Samba File Server in Linux and pursuing the LPIC1 Certification

  It's been a little while since I have posted here, so a quick recap on my IT journey over the past few years:

-Landed a role as a systems administrator - primarily overseeing Windows but with evolving Linux duties
-Obtained my AZ-900 Azure fundamentals certification
-Took a deeper interest in Linux and am currently working professionally with Red Hat, an enterprise-catered Linux distro
-In the midst of preparing for the two exams which encompass the LPIC1 Certification

  Although I have certainly dabbled in Linux in the past - both in terms of pentesting labs and fundamentals of the OS, I recently began getting a much better grasp of the OS and it's hierarchy and basic commands. 

  One facet that has really been helpful in making it all click has been seeing a logical layout of the hierarchy of the directory structure and better understanding the commonality of what kind of system data each of these directories contain (and this is mostly regardless of which of the many Linux distros you are working in).





  Beyond this, another useful basic skill is learning to use NANO and/or VIM, the text editors in Linux. I personally, have taken more of a liking to VIM (which is technically the improved version of it's predecessor, VI).

  It was suggested that I undertake some projects alongside my studies and I decided on creating a Samba File Server. In the simplest terms, this is a Linux software package that allows for the mounting of a single (or multiple) shared drives for the purpose of transferring files between different OS's like Windows, Mac, and Linux using the SMB file sharing protocol. Essentially, if you have a Windows PC at home and a separate Mac or Linux, you're probably relegated to the sneaker method of file sharing (literally running back and forth between both with a flash drive to transfer files). The process for setting up Samba isn't too complicated, but if you miss a step, including signifying username/password login rights you could be scratching your head for hours. 

  My Linux setup (using the Fedora distro) is on a virtual machine within the Virtualbox hypervisor on my Macbook.  Assuming you're up and running already with any sort of Linux VM, you can install Samba with the following commands via the Terminal (or in the case of Fedora, what they call the "Konsole").

sudo smbpasswd -a YourUsernameHere

mkdir /home/YourUsernameHere/share
sudo semanage fcontext --add --type "samba_share_t" "/home/
YourUsernameHere/share(/.*)?"
sudo restorecon -R ~/share

  Next, you need to edit the /etc/samba/smb.conf file using either NANO editor or VIM(VI) Editor.
I actually ran into an issue at first where it would let me open this .conf file for editing but when it came time to save changes, got a permission denied error. I ran chmod 755 smb.conf to correct this. After running this command to allow me full read/write/execute rights on the file, I was able to edit the smb.conf file and write/quit (:wq is the equivalent of "save" in VIM) and apply the changes I made to the file.

Below is the text I had to add to the conf file:

[share]

    comment = My Share
   
    readonly = no


    path = /home/YourNameHere/share

    writeable = yes

    browseable = yes

    public = yes

    create mask = 0644

    directory mask = 0755

    write list = user

  The last issue I ran into was when it came the time to finally connect to the SMB "share" folder from both my host Mac OS as well as my PC Laptop. When using virtual machines, the networking aspects can be confusing for those unseasoned among us. I ended up needing to switch from the default setting of NAT (Network Address Translation) to "Bridged Adapter" seen below and choosing "Wifi". If my Macbook was hardwired/ethernet-cable-connected, I of course would choose the "en" dropdown option for that.





  With this legwork now complete, I was able to punch in the IP address of my Linux VM in the address bar of File Explorer on my Windows PC and receive that glorious pop-up prompt for login credentials to access the SMB/Samba server-associated "share" folder and freely move files back and forth. Those credentials, of course, being the ones I created in the linux Terminal/Konsole earlier. And via Mac, the same basic thing is done using the Go>Connect to Server option. Success! No more running back and forth with a flash drive!

  To study for the LPIC1, which is essentially the same certification as the Linux+, I am using Jadi's free (and excellent) video course on Youtube alongside his free written lessons. I highly recommend his lessons, as he is very engaging and great at breaking down kernel-level concepts. The LPIC1 is a distro-neutral certification, meaning that it includes objectives centered around commands and functions that are used in both Debian and RPM-based distros of Linux (Debian and RPM relate to the different package managers/installation structures existing on different distros. Each Linux distro falls into either the RPM camp or the Debian camp). The certification encompasses the foundational knowledge needed to be proficient (from a systems administrator standpoint) in everything from Ubuntu to Arch Linux to Red Hat to everything in between.

  One main difference between LPIC1 and Linux+ and the reason I went with LPIC1 is that the LPIC1 is good for 5 years right out of the gate once passed. The Linux+ by Comptia is only good for 3 years. Obtaining a higher-level Linux cert on either the Comptia or LPIC path then re-activates the respective lower-level cert as well. Also worth mentioning is that the LPIC1 is broken up into two exams rather than the Linux+, which is just one. This is helpful for those who would rather build up their skills in the objectives to the best of their ability and in two chunks rather than having to memorize twice the material at once. For how deep many of the concepts are and for the plethora of different commands across multiple distros being studied, this felt like the better fit.

LPIC1 Objectives list:
https://www.lpi.org/our-certifications/exam-101-objectives/ 
https://www.lpi.org/our-certifications/exam-102-objectives/

Provided below are the links to Jadi's course, as well as a link to donate to him if anyone should feel so inclined.

Jadi's written LPIC1 course

Jadi's LPIC1 video course

Donate to Jadi here