Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Sunday, February 17, 2019

How to Linux or Something Like That

I am by no means a Linux expert, but at work I am the one they tend to defer to with "how do I Linux" questions. So maybe it would be worthwhile to make a small beginner guide on how to at least pretend you know what you're doing. So let's get out the basic "gotchas" of Linux and some semantics.

Linux is a kernel. Linux is to Ubuntu (or whatever you flavor is) as Windows NT is to Windows 7. I sometimes com across those snarky "Linux isn't an OS" comments online and it gets annoying, but this is the brief explanation to those.

Linux itself comes in different distributions referred to as "distros" or "flavors." If you're gonna talk about Mint, flavors seems like the better term, although it may get weird when you talk about Puppy being your favorite flavor. Sometimes different distributions are just the same one with a different desktop environment (DE) or software pre-loaded on it. Some desktops include things like Gnome, KDE, X11, xfce, MATE, LXQt, etc. There are a lot of desktop environments. To further add to some confusion, there are also window managers (WM) like xmonad, i3, and a million other ones. When discussing with others the environments they use, it can get complicated and layered because everyone uses a million and one things just to stick two windows on the screen at just the right location and spacing.

Personally, I use things mostly default because I often have to move around to a lot of different environments. I use CentOS minimal (no DE), Kali, Windows 7, Windows 10, Mac OSX Sierra, Ubuntu and various derivatives of, just to name a few.

If you're looking to pick the right distro for you, you can check out Distro Watch, they keep up to date on everything. Browsing there, you can find quite literally hundreds to choose from. Each one varies to some extent with the file structure, commands, or general way of doing things.

One of the big things for people starting out is the package manager. Without being able to install software, there are limitations for those that don't just make things themselves and package managers are the biggest help. It's one of the things that I loved when starting out with Linux. You can download or keep up-to-date all of your software in a simple manor. Each distro has its own way of doing things. Debian based has aptitude, RedHat based has yum, Arch based has pacman, and so on. Most have some form of package tool and special format.

I'm on Kali right now, so if I want to update all of my stuff, I may do something like:

apt-get update && apt-get upgrade -y

This is really dependent on what distro you're on, what kind of updates you're getting (like if you're on a rolling distro), and the like.

Now a brief look at file structures. The root file is /. It contains a handful of folders such as bin (user binaries), boot (boot files), dev (device files), etc (configuration files), home (user folders), lib (libraries), mnt (mount), opt (optional apps, usually ones you install outside of a package manager will end up here), proc (process information), root (root user, not to be confused with the file root), sbin (system binaries), srv (service data), tmp (temporary files), usr (user programs), and var (variable files such as logs, default web root for web services, etc.). Chances are you actually have many more than that, and it all depends on the distribution. I'm personally a fan of how Linux handles devices in the dev folder allowing you access to devices in similar ways you interact with files.

Shells. Your shell on a Linux system is an invaluable tool for when all else fails. Knowing how to use it is immensely helpful, and customizing it to make it your own is very satisfying. Most variations seem to default to Bash (Bourne Again Shell), based off of the Bourne Shell. There are numerous other variations such as Korn shell (ksh), Almquist Shell (ash), Dash (default for recent debian distros), C shell (csh), tcsh (unix compatible c shell that Mac used for a while), Friendly Interactive shell (fish), Z shell (zsh), and many more. Most of them have cross compatibility with minor changes here and there for syntax and the big distinction being how they handle interactive sessions.

Personally, I use zsh with Oh-my-zsh!, and tmux (a terminal multiplexer) when I'm getting down and dirty. For scripting, I stick to good ol' Bash... or Python or Tcl, depends on what I'm doing really. Tcl seems to pop up at random and I use it at work for a custom backup script for the many switches we have (with expect).

Some of the more basic things you would do to get started on Linux and really grab into the shell is basic file navigation and text editing. When it comes to text editing, I love Vim. My favorite thing about Vim/Vi is how quick and easy it is to do stuff when you know what you're doing. My second favorite things is when people copy a command with vi or vim in it and have no idea what they're doing. You see kids, Vi is a visual text editor that requires knowing commands in it to edit, save, and even exit it. There is also nano, which is to speed with most newcomers, but not every distro comes with it. So let's go over a quick and incomplete Vi/Vim lesson!

To quit the program you type :q
To move the cursor, you can use arrows or h (left), j (down), k (up), l (right)
To insert text (go into insertion mode), i inserts on the cursor, a inserts after, I inserts at the very beginning, A at the very end of the line
To stop inserting, press esc
Backspace doesn't always work, delete always does, x will delete when not in insertion mode
To save you type :w
To save and quit you can type :wq or :x
To quit without saving, you type :q!

There are also ways to copy and paste, regex substitute, find, and all sorts of things. If you start getting used to it now, you can soon start to learn all the other cool things.

Let's say we want to edit the hostname on a computer. We do something along the lines of:

cd /etc
vim hostname

Then press i, type in the hostname, press esc, then :wq
We can then restart the computer. So what are some quick and easy commands to get started?

cd <directory> (change directory)
mkdir <directory> (make directory)
touch <file> (create a file)
rm <file> (remove a file)
cp <file1> <file2> (copy a file)
mv <file1> <file2> (move or rename a file)

There are a lot of commands, and it changes from system to system to some degree. Without getting into one specifically, it's hard to go too in-depth.

So how do you pick a distro for you to get started? Major distributions are a good start with the large communities and lots of documentation and tutorials. Ubuntu, Mint, CentOS, Debian, Fedora, Manaro are just a handful of some of the major ones. I personally started out with Ubuntu. With Ubuntu I could do everything with GUI and introduce myself into command line stuff at my own pace. After that, I learned how to configure and run systems entirely from the command line.

Saturday, December 22, 2018

Getting Certified for Beginners in IT

For those just starting out in IT, to those looking to change careers, getting certifications is a great place to start. From my experience, employers love certifications. Whether or not the certification is actually as useful as people think is an entirely different story. Now getting a certification is not a magic key for a job, but it can be some heavy leverage. It's a piece of paper that specifically says that you can do that type of job and are backed by an industry standard that you are indeed capable by there standings. So where to begin?

Every job I applied to, and the job I currently work, consider the CompTIA A+ the starting point of being an IT Specialist. Sure people get hired without it, but at my place of employment, they expect you to either acquire or have supplemental experience/education with credible proof. I will say that the CompTIA IT Fundamentals is as useful as toilet paper, so try to start with the A+. There are other companies with other certifications, but the A+ is the go to. So what does an A+ mean? Well, it's pretty much a basic understanding of computers, operating systems, and troubleshooting. Pretty much the job description of IT, the only thing you need to add on is that you're good with Office suites like Microsoft Office, and maybe tack on some free ones like Libre Office and OpenOffice.

Despite the A+ being a job description for IT work, like a help desk, it's just saying you meet expectations. In the day of the Internet, networking is something every IT person should at least understand. This includes things like the OSI model, different technologies used, network services, and the like. When it comes to networking, there are two routes you can go. CompTIA Network+ is the normal go to if you're not wanting to go heavy into networking, but the Cisco certifications like the CCNA are held in high regard. Even if you don't use a Cisco network, their certifications are held very high when it comes to networking.

Once you cover these two areas, you should have the proof you need that you can IT. After that you can branch out into quite a few different areas. They include Security, Infrastructure (Cloud and/or Server), and Networking to name some. Those of course branch off into more specific groups.

When looking at security, there's the CompTIA Security+, CySA+, PenTest+, and CASP+. There's also other companies such as SANS with the GIAC stuff, EC-Council with their well known CEH (certified Ethical Hacker) to get you started, and Offensive Security (who brings Kali Linux to the table) with a certification that shows you can penetration test in the real world. There are so many good options here, especially with everyone trying to get into the penetration testing stuff.

With networking, your best bet is to get into Cisco's certifications. To be honest, I don't recall seeing much else asked for outside of Cisco certs beyond the minimum of a Network+. It's also a good start with so many companies emulating what Cisco does and the way they do things, so you still are quite versatile.

Infrastructure is a unique area because it often requires some advanced networking, security knowledge, and a million and one tools and commands to pull out of thin air. When it comes to the cloud stuff, I have never really looked at it. When it comes to the server stuff, there's of course some that CompTIA have, like the Server+. Other options worth exploring are the certifications offered by Microsoft themselves. Let's face it, they're everywhere. There are of course other things out there that can be just as important, or even more so. In steps Linux. CompTIA does have the Linux+, but I think the Redhat certifications are a better bang for your buck. Redhat and CentOS seem to be the heavy hitters in the Linux world that actually require some knowledge. Every Ubuntu based server I've delt with at work was either shipped pre-configured or just a script you ran and called it quits. I manage the CentOS servers we use for mass image deployment across our locations. We have security cameras that use Ubuntu servers, but those are already setup and our camera guy is usually only running updates or wget and a shell script. There's a few other places that offer certifications, but none spring to mind.

I should also add that there are certifications for virtualization that can be valuable for Networking and Infrastructure. There's plenty of information on it if you go check out VMWare and their certification path.

So how do you decide which way to go? Well, start with the A+ and Network+. Figure out an industry you want to work in or type of area. Then just take the more general varieties and narrow it down as you go. So... Good luck!

Wednesday, March 14, 2018

Techs from the Crypt: I don't understand!

Realistically, I have not been a tech for very long, however I work on four different sites normally and interact with quite a lot of people. In my travels, I have come across some humorous, horrifying, and down right strange scenarios. I will now share them with you as part of an attempt at a running series I am calling "Techs from the Crypt" as homage to a favorite show of mine as a kid, Tales from the Crypt! Get it? Did I really need to explain it?

Moving on, I will make up names where needed, not so much to protect the people involved, but more so because I don't care enough to remember anyone's name. Luckily my time in retail has taught me how to cover up my anti-social nature and severe anger towards the more remedial tasks I'm expected to perform.

As a tech, I often come across a lot of people who say something along the lines of "I don't know," or "I don't understand." I often feel myself rewording what I say many times over to make a point or even get some acknowledgement that there is thought behind the vacant stare and hysterical smile of someone completely distraught because "the Internet is broken," or "I didn't do anything and it's no longer working." I'm sure almost every field you can be in has some variation of this interaction, be it with co-workers or clients. So now I submit to you a story about a lady who even when I think back on it, I find hard to believe she actually did all the things she did.

I work for a school system, so most of the people I help are teachers, those we trust to educate our youths. This particular case was at an elementary school. I received a work order about a teacher, we shall call her Mrs. Lego (part of an inside joke I may mention later), could not log into her Google account. Now when an account is setup on our system, a Google account is created. The problem is that you cannot log on to the account until after you change your password and then it gets synchronized with Google. I was quite confident in dealing with these cases as it was the beginning of the year and a lot of new teachers sent in identical work orders. With that, I marched off to the school to get the new teacher squared away.

So far it all seemed routine, and then I met the teacher. Now, let me be clear, she was and is a very nice lady who has never been intentionally rude to me even when I almost lost my temper. However, I would not say Mrs. Lego is the most receptive of people. After explaining to me her problem, I explained to her that she needed to change her password and showed her how. Now, our passwords have complexity requirements that are more strong than some of the other unconnected systems certain groups of staff need to use, usually due to just software limitations. Mrs. Lego tried to change her password to one she had previously setup on one of these particular systems. After it rejected her twice, I asked her to tell me the password. I then explained to her that because of the complexity requirements, it needs more to it, like a special character, maybe an exclamation mark at the end or something simple to remember like punctuation.

"But I want it to be the same password for everything," stated Mrs. Lego quite adamantly.

"Well, I understand that, but I cannot change these requirements. To access Google through your account, it's required to change your password."

"But I need them to be the same, or else what's the point?"

"To access Google, you NEED to change your password."

"Well, why can't I use this one?"

"Because there are requirements that need to be met."

"I don't think you're understanding me. I have my password for that set. I want them to be the same passwords."

"I get that, but unless you change both passwords, we can't make this one the same."

"No, you don't understand, I want my password-"

"To be the same as the other one, I get what you're saying but I cannot do that for you."

"Oh... well then there is no point in changing my password, how do I go back?"

"To access your Google account you HAVE to change your password."

"But I don't want to unless they can match."

This is the shortened version, as this conversation then continued on for some more time. Finally, my patients were gone. She was convinced I couldn't understand what she wanted so now she wants everything back but wants to access her Google account. I was so fed up, I did the only thing I could within my power. I fired up Google Admin Console and manually entered her default password and reluctantly left that be. However, it does not end there, oh no my friends. You see, she was a new teacher and had questions. Many questions. We have instructional people for such questions, but I was nice enough (dumb enough is more like it) to attempt to help to the best of my ability.

You see, at one point they thought it was a good idea to try to continue the use of old outdated computer by installing Ubuntu on them. As a Linux user, I informed them many times after I started and came across this that Ubuntu os a full featured OS, it is not lightweight or good for repurposing old computers. Mrs. Lego had two and one with Windows still on it. The Ubuntu computer log in automatically and the Windows they are recommended to use a class login. After explaining to her the class login and showing her the Windows computer, we discussed the Ubuntu. I explained to her they really are just there for web browsing, there is no Microsoft office or the like on them.

"So, they're not real computers?"

"No, they are just older computers that the schools are trying to reuse to save money."

"At the school system I come from, they stripped out the guts of old computers and called them Linux machines."

"...uh... yeah... same thing?..."

"Well, can I get real computers instead?"

"... uh... tell you what... put... put in a work order and... I'll see if I can scrap together some parts and get Windows on them..."

"Oh, that would be great, what do I put down?"

So I gave her word for word what to put down and then made a mental note to upgrade the RAM so it could handle Windows and try to get this wonderful woman out of my hair.

Then for a bit, we talked about the tech and differences between school systems. I thought it was over and I had weathered the storm, then while I was mid-sentence, she walked over to the door and said she needed to go pick up the kids... and walked out before I could even respond.

It's at times like those that I wonder how people get there in life, or how they often seem better off than me. Perhaps it's just the chipping away of my soul that makes the other side seem so much better. Mrs. Lego went on to terrorize our instructional techs after I told her to submit a work order for them to come by and walk her through the tech.

You see, when one of them was talking to her, he passed the comment that this stuff is easy, jut plug it together, like Lego...

"But I don't have any Legos."

And that, my friends, is the story of Mrs. Lego and why I don't understand. I hope you enjoyed. I have a few other stories I hope to get down before I forget too much detail and make it hard to put in a decent story form.

Thursday, December 19, 2013

Purge old man pages for apropos

This is something I wanted to do for a while on Ubuntu, and I'm not sure if it will work on other distributions. The main problem is that I would remove a program and the man page for it would remain. This gets annoying when I'm searching for stuff and end up double checking on what was removed or decide to try a command I removed. The solution is simple, but takes a few minutes to run. As root, run these commands.

cd /usr/share/man
rm -R /var/cache/man
mandb

As simple as that and all the old stuff gets removed. This just simply removed the cached manual pages then reconstructs it.