this post was submitted on 27 Jul 2024
196 points (96.2% liked)

Linux

47290 readers
1007 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

I'm trying to get a job in IT that will (hopefully) pay more than a usual 9 to 5. I'm been daily driving Linux exclusively for about 2 1/2 years now and I'm trying to improve my skills to the point that I could be considered a so-called "power user." My question is this: will this increase my hiring chances significantly or marginally?

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 45 points 1 month ago (18 children)

I interview developers and information security people all the time. I always ask lots of questions about Linux. As far as I'm concerned:

  • If you're claiming to be an infosec professional and don't know Linux you're a fraud.
  • If you're a developer and you don't know how to deploy to Linux servers you're useless.

So yeah: Get good with Linux. Especially permissions! Holy shit the amount of people I interview that don't know basic Linux permissions (or even about file permissions in general) is unreal.

Like, dude: Have you just been chmod 777 everything all this time? WTF! Immediate red flag this guy cannot be trusted with anything.

[–] [email protected] 7 points 1 month ago (8 children)
  1. What are basic Linux permissions?
  2. What does chmod 777 do?
[–] [email protected] 14 points 1 month ago (6 children)

Quick and dirty: the basic permissions are read, write, and execute, and are applied to the owner, the group, and everyone else. They're applied to all files and directories individually.

It's represented by a 3 digit number (in octal, which is base 8, so 0 to 7). The first number is the permission given to the file's owner, the second to the file's group owner, and the third to everyone else. So, the owner of the file is the one user account that owns it, the group applies to all members of that group. User and group ownership are also applied to each file and directory individually.

Read, write, and execute are represented by the numbers 4, 2, and 1, respectively, and you add them together to get the permission, so 0 would be nothing, 1 would be execute but not read or write, 2 would be write but not read or execute (and yes there are uses for that), 3 would be write and execute but not read, 4 is read only, etc through to 7 which is basically full control.

This will take a little bit to make sense for most people.

chmod (change modifier, I think) is the program you use to set permissions, which you can do explicitly by the number (there are other modes but learn the numbers first), so chmod 777 basically means everyone has full control of the file or directory. Which is bad to do with everything for what I hope are obvious reasons.

chown (change owner) is the program you use to set the owner (and optionally the group) of a file or directory, and chgrp (change group) changes the group only.

It gets deeper with things like setuid bits and sticky bits, and when you get to SELinux it really gets granular and complex, but if you understand the octal 3 digit permissions, you'll have the basics that will be enough for quite a lot of use cases.

(Additionally to the 3 digit number, permissions can be represented a bit friendlier where it just lists letters and dashes, so 750 (full control user, read and execute group) could be shown as rwxr-x---, where r=read, w=write, and x=execute, and what they're applied to can be represented by the letters u for user (aka owner), g for group, and o for other)

This goes into more detail of those basics: https://opensource.com/article/19/6/understanding-linux-permissions

[–] [email protected] 3 points 1 month ago (2 children)

Thanks. Bookmarking for future reference.

[–] [email protected] 4 points 1 month ago

Juwt remember "man chmod".

[–] [email protected] 2 points 1 month ago

Also, they didn't mention it but you can always just do this (the easy way, thanks to GNU): chmod a+x somefile to give it execute bits. It works intuitively like that for w and r permissions too.

It's just quicker to type out chmod 775 than it is to do it the other way 🤷

load more comments (3 replies)
load more comments (4 replies)
load more comments (13 replies)