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

Linux

48329 readers
639 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
[–] riskable@programming.dev 45 points 3 months ago (5 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.

[–] ByteOnBikes@slrpnk.net 8 points 3 months ago

Have you just been chmod 777 everything all this time?

Oh man, I ran into a dev at a meetup who proposed this solution.

And I had to do a polite, "Oh wow maybe that works but I don't think that's a solution in my company" because YIKES.

[–] SpiceDealer@lemmy.world 7 points 3 months ago (2 children)
  1. What are basic Linux permissions?
  2. What does chmod 777 do?
[–] laurelraven@lemmy.blahaj.zone 14 points 3 months ago (2 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

[–] Saizaku@lemmy.dbzer0.com 5 points 3 months ago* (last edited 3 months ago) (1 children)

Read, write, and execute are represented by the numbers 4, 2, and 1, respectively, and you add them together to get the permission

Maybe I'm the weird one here but this seems like a counter intuitive way to remeber/explain it. Each octal digit in the three digit number is actually just 3 binary digits ( 3 bit flags) in order of rwx. For example read and execute would be 101 -> 5.

[–] laurelraven@lemmy.blahaj.zone 3 points 3 months ago (1 children)

While that's literally what it is, that's not really how it's represented and requires also understanding binary numbers.

Even knowing that, I've always found it easiest to get to the permissions the way I described, which when you think about it is actually the same as what you'd do to translate binary into decimal/octal if you don't have them memorized: look at the values of each position that's set to 1 and add them together. So, 101 in binary would be 4+0+1, or 5, which is the same as saying read is 4 and execute is 1 and add them together, the latter of which I think is easier to learn (and is how I've always seen it taught, though clearly YMMV)

Both get you to the same place though

[–] Saizaku@lemmy.dbzer0.com 2 points 3 months ago

That's a fair point, I guess I used binary numbers so much i uni that I just know the small ones by heart and that's why I find it easier. Following the example, I never convert 101 as 4+0+1, I just see it and know it's 5.

[–] SpiceDealer@lemmy.world 3 points 3 months ago (2 children)

Thanks. Bookmarking for future reference.

[–] ouch@lemmy.world 4 points 3 months ago

Juwt remember "man chmod".

[–] riskable@programming.dev 2 points 3 months 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 🤷

[–] Swedneck@discuss.tchncs.de 1 points 3 months ago

"chmod 777 is opening your front door with a sledgehammer"

[–] Shareni@programming.dev 6 points 3 months ago

If you're a developer and you don't know how to deploy to Linux servers you're useless.

Welp, found your red flag

[–] communism@lemmy.ml 6 points 3 months ago (2 children)

Can I ask if the reverse applies, eg is having no idea how to use non Unix like OSes (like Windows) any kind of red flag? Kinda been considering trying to go into a tech career so that I can have a 9-5 office job (I've until recently worked in what would be considered "blue collar" jobs, recently switched to an education job, would be nice to just sit down in an office and use computers for a living). I've used (GNU/)Linux from a very young age (parents had an Ubuntu laptop), as my primary OS/daily driver since I was 13, and exclusively (i.e. got rid of my Windows partition due to Windows enshittification) since I was idk maybe 16 ish? So I'm pretty comfortable doing things in Linux. But I have a reputation for being a tech person among my friends and they ask me to fix their stuff sometimes and whenever it's a Windows problem I literally have no idea how to use the OS lol. So are Windows skills and knowledge also expected for tech jobs or just Linux/Unix-like?

[–] billgamesh@lemmy.ml 7 points 3 months ago

Depends on the tech job. A lot of corporate IT support jobs care a lot more about troubleshooting windows because that's what the employees use

[–] riskable@programming.dev 2 points 3 months ago (1 children)

There's not much to learn in Windows land! Learn how to set file permissions, how the registry works (and some important settings that use it), and how Active Directory works (it's LDAP) and you'll be fine.

If you're used to using Linux nothing will frustrate you more than being forced to use a Windows desktop. The stuff you use every day just isn't there. You can add on lots of 3rd party tools to make it better but it'll never measure up.

When you have to go out on the Internet to download endless amounts of 3rd party tools the security alarms in your head might start going off. Windows users have just learned over time to ignore them 🤣

[–] communism@lemmy.ml 4 points 3 months ago

If you’re used to using Linux nothing will frustrate you more than being forced to use a Windows desktop. The stuff you use every day just isn’t there.

Absolutely. I tried using Windows for gaming some years back when Wine wasn't as good and it was such a struggle. I was used to thinking there's more software for Windows since it's more widely used, but I was shocked at both how much software I used was Linux (or POSIX-compliant) only, some of which had no Windows alternative. I remember struggling so much to just try and get some files off a LUKS-encrypted drive on Windows and was shocked that there was basically no option at the time. I also hate how Windows users just download random exes off the web for all their programs. I only ever used chocolatey to install anything for that brief Windows stint.

[–] model_tar_gz@lemmy.world 5 points 3 months ago (1 children)
[–] grrgyle@slrpnk.net 3 points 3 months ago (1 children)

Lol been there, and with the -R too

[–] model_tar_gz@lemmy.world 2 points 3 months ago* (last edited 3 months ago)

Sorry for your loss. I hit myself with the ‘rm -rf /*‘ several years back when I was actually trying to do ‘rm -rf ./*‘.

Now I do ‘ls’ instead of ‘rm’ just to make sure that what I’m deleting is what I’m intending to.

Figured I was very lucky that it was just on my own workstation and not on any of the servers I was tasked with maintaining. I lost a day or so of work. Had it been our dev server? Would’ve destroyed my team for a while.