Home Blog Page 343

Users, Groups and Other Linux Beasts: Part 2

In this ongoing tour of Linux, we’ve looked at how to manipulate folders/directories, and now we’re continuing our discussion of permissions, users and groups, which are necessary to establish who can manipulate which files and directories. Last time, we showed how to create new users, and now we’re going to dive right back in:

You can create new groups and then add users to them at will with the groupadd command. For example, using:

sudo groupadd photos

will create the photos group.

You’ll need to create a directory hanging off the root directory:

sudo mkdir /photos

If you run ls -l /, one of the lines will be:

drwxr-xr-x 1 root root 0 jun 26 21:14 photos

The first root in the output is the user owner and the second root is the group owner.

To transfer the ownership of the /photos directory to the photos group, use

chgrp photos /photos

The chgrp command typically takes two parameters, the first parameter is the group that will take ownership of the file or directory and the second is the file or directory you want to give over to the the group.

Next, run ls -l / and you’ll see the line has changed to:

drwxr-xr-x  1 root photos  0 jun 26 21:14 photos

You have successfully transferred the ownership of your new directory over to the photos group.

Then, add your own user and the guest user to the photos group:

sudo usermod <your username here> -a -G photos
sudo usermod guest -a -G photos

You may have to log out and log back in to see the changes, but, when you do, running groups will show photos as one of the groups you belong to.

A couple of things to point out about the usermod command shown above. First: Be careful not to use the -g option instead of -G. The -g option changes your primary group and could lock you out of your stuff if you use it by accident. -G, on the other hand, adds you to the groups listed and doesn’t mess with the primary group. If you want to add your user to more groups than one, list them one after another, separated by commas, no spaces, after -G:

sudo usermod <your username> -a -G photos,pizza,spaceforce

Second: Be careful not to forget the -a parameter. The -a parameter stands for append and attaches the list of groups you pass to -G to the ones you already belong to. This means that, if you don’t include -a, the list of groups you already belong to, will be overwritten, again locking you out from stuff you need.

Neither of these are catastrophic problems, but it will mean you will have to add your user back manually to all the groups you belonged to, which can be a pain, especially if you have lost access to the sudo and wheel group.

Permits, Please!

There is still one more thing to do before you can copy images to the /photos directory. Notice how, when you did ls -l / above, permissions for that folder came back as drwxr-xr-x.

If you read the article I recommended at the beginning of this post, you’ll know that the first d indicates that the entry in the file system is a directory, and then you have three sets of three characters (rwx, r-x, r-x) that indicate the permissions for the user owner (rwx) of the directory, then the group owner (r-x), and finally the rest of the users (r-x). This means that the only person who has write permissions so far, that is, the only person who can copy or create files in the /photos directory, is the root user.

But that article I mentioned also tells you how to change the permissions for a directory or file:

sudo chmod g+w /photos

Running ls -l / after that will give you /photos permissions as drwxrwxr-x which is what you want: group members can now write into the directory.

Now you can try and copy an image or, indeed, any other file to the directory and it should go through without a problem:

cp image.jpg /photos

The guest user will also be able to read and write from the directory. They will also be able to read and write to it, and even move or delete files created by other users within the shared directory.

Conclusion

The permissions and privileges system in Linux has been honed over decades. inherited as it is from the old Unix systems of yore. As such, it works very well and is well thought out. Becoming familiar with it is essential for any Linux sysadmin. In fact, you can’t do much admining at all unless you understand it. But, it’s not that hard.

Next time, we’ll be dive into files and see the different ways of creating, manipulating, and destroying them in creative ways. Always fun, that last one.

See you then!

Learn more about Linux through the free “Introduction to Linux” course from The Linux Foundation and edX.

How Developers Can Get Involved with Open Source Networking

Linux Foundation open networking leader describes the challenges and advantages of working across communities.

There have always been integration challenges with open source software, whether in pulling together Linux distributions or in mating program subsystems developed by geographically distributed communities. However, today we’re seeing those challenges writ large with the rise of large ecosystems of projects in areas such as networking and cloud-native computing.

Integration was one topic of my conversation with Heather Kirksey, the VP of Community and Ecosystem Development at the Linux Foundation, recorded for the Cloudy Chat podcast. We also talked about modularity and how developers can get involved with open source networking. For the past three years, Kirksey has directed the Linux Foundation’s Open Platform for Network Functions Virtualization (OPNFV), which is now part of the LF Networking Fund that’s working to improve collaboration and efficiency across open source networking projects.

“One of the challenges we have right now is that we have brought together a bunch of formerly discrete networking communities,” says Kirksey.

Read more at OpenSource.com

Google Launches Jib, Automated Container Packaging for Java Apps

Google has released software that could automate the packaging of a Java program so that it can be run in the cloud-native environment.

Jib is an open-source Java “containerizer,” one that handles all the steps of packaging your application into a container image, according to Appu Goundan and Qingyang Chen, two Google engineers who co-wrote a blog post announcing the new technology.

Created over two decades ago at Sun Microsystems, Java was introduced as a “write once, run anywhere” programming language, where all the code would be packaged in a JAR file, and run by a Java Virtual Machine on any platform. The requirements for running code anywhere have expanded with the introduction of containerization, however. Few shops are Java-only these days, and many are turning to containerization for true application portability,

Read more at The New Stack

New IEEE Position Statement Supports Strong Encryption

On 24 June, the IEEE Board of Directors adopted a position statement in support of strong encryption for confidentiality and data integrity.  The essence of the position is that:

“IEEE supports the use of unfettered strong encryption to protect confidentiality and integrity of data and communications. We oppose efforts by governments to restrict the use of strong encryption and/or to mandate exceptional access mechanisms such as “backdoors” or “key escrow schemes” in order to facilitate government access to encrypted data. Governments have legitimate law enforcement and national security interests. IEEE believes that mandating the intentional creation of backdoors or escrow schemes — no matter how well intentioned — does not serve those interests well and will lead to the creation of vulnerabilities that would result in unforeseen effects as well as some predictable negative consequences.”

Read more at IEEE

Wi-Fi Security Is Starting to Get its Biggest Upgrade in Over a Decade

Wi-Fi devices have been using the same security protocol for over a decade. But today, that’ll begin to change: the Wi-Fi Alliance, which oversees adoption of the Wi-Fi standard, is beginning to certify products that support WPA3, the successor to the WPA2 security protocol that’s been in use since 2004.

The new protocol provides a number of additional protections for devices connected over Wi-Fi. One big improvement makes it harder for hackers to crack your password by guessing it over and over again, and another limits what data hackers can see even once they’ve uncovered the passcode. Nothing will change as far as users see it; you’ll still just type in your password and connect to the network.

WPA3 protections won’t just flip on overnight — in fact, it’s going to be a many-years-long process. First, you’ll have to buy a new router that supports WPA3 (or hope that your old one is updated to support it).

Read more at The Verge

Announcing Release 3 of Ceph Storage for Oracle Linux

We are excited to announce Release 3 of Ceph Storage for Oracle Linux. This release presents a uniform view of object and block storage from a cluster of multiple physical and logical commodity-hardware storage devices. Ceph can provide fault tolerance and enhance I/O performance by replicating and striping data across the storage devices in a Ceph Storage Cluster. Ceph’s monitoring and self-repair features minimize…

Click to Read More at Oracle Linux Kernel Development

Announcing Release 3 of Ceph Storage for Oracle Linux

We are excited to announce Release 3 of Ceph Storage for Oracle Linux. This release presents a uniform view of object and block storage from a cluster of multiple physical and logical commodity-hardware storage devices. Ceph can provide fault tolerance and enhance I/O performance by replicating and striping data across the storage devices in a Ceph Storage Cluster. Ceph’s monitoring and self-repair features minimize…
Click to Read More at Oracle Linux Kernel Development

Announcing Release 3 of Ceph Storage for Oracle Linux

We are excited to announce Release 3 of Ceph Storage for Oracle Linux. This release presents a uniform view of object and block storage from a cluster of multiple physical and logical commodity-hardware storage devices. Ceph can provide fault tolerance and enhance I/O performance by replicating and striping data across the storage devices in a Ceph Storage Cluster. Ceph’s monitoring and self-repair features minimize…

Click to Read More at Oracle Linux Kernel Development

Attend Live Webinar: Are Your Containers Secure?

K Live Webinar Are Your Containers Secure? USA, Canada and Latin America: Date: July 31, 2018  Time: 9:00 AM PT / 12:00 PM ET  1 PM Sao Paulo/ 11 AM Mexico Register   Europe, Middle East, Africa: Date: July 31, 2018 Time: 5:00 BST/16:00 CEST/16:00…

Click to Read More at Oracle Linux Kernel Development

Attend Live Webinar: Are Your Containers Secure?

K Live Webinar Are Your Containers Secure? USA, Canada and Latin America: Date: July 31, 2018  Time: 9:00 AM PT / 12:00 PM ET  1 PM Sao Paulo/ 11 AM Mexico Register   Europe, Middle East, Africa: Date: July 31, 2018 Time: 5:00 BST/16:00 CEST/16:00…

Click to Read More at Oracle Linux Kernel Development