Non Root Gluster CLI access

Non Root Gluster CLI access

Glusterfs binaries and files, if one had to explore will fall under the root user. In nix everything is a file. Thereby it is only the owner of a file and people in the allowed group who can execute a binary.

Glusterfs binaries and files, if one had to explore will fall under the root user. In nix everything is a file. Thereby it is only the owner of a file and people in the allowed group who can execute a binary. Does that mean non root user cannot run Glusterfs?

If one were to work in a system wherein the default user is say ant which is not a part of the sudoers file. This implies that they won’t be able to access ( be it opening the file or telling the system to execute the contents of that file ) the files in the file system which are not in their group or falling under *ant *user.

If *ant *were to run a gluster command say

## gluster vol status

They’d be greeted with a sweet response of

ERROR: failed to create logfile "/var/log/glusterfs/cli.log" (Permission denied)
ERROR: failed to open logfile /var/log/glusterfs/cli.log

The reason being *ant *doesn’t have the necessary privileges to run the gluster cli commands. Now there are various workarounds to this..

  1. Adding ant to sudoers group and running the commands with sudo
  2. Setting the setuid bit of the binary.

The path 1 is pretty straightforward so we won’t look into it and also, this begs the question as to what if the sys admin is pretty adamant as to not to provide sudo privileges to ant.

So, enter setuid bit…

glusterfs linux

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Hire Dedicated Linux Developer

Looking to develop real-time applications? **[Hire Dedicated Linux Developer](https://hourlydeveloper.io/hire-dedicated-linux-developer/ "Hire Dedicated Linux Developer")** from **[HourlyDeveloper.io](https://hourlydeveloper.io/...

How I Switched from Windows 10 to Linux Mint

This article is all about my journey on switching from Windows 10 to Linux Mint 20, how I got easily adapted to the Linux environment, and some resources that helped me to set up a perfect Desktop environment.

User Administration in Linux - Linux Tutorial - Linux Training

User Administration in Linux - Linux Tutorial - Linux Training

Package Management in Linux - Linux Tutorial - Linux Training

Package Management in Linux - Linux Tutorial - Linux Training

10 Best Ubuntu-based Linux Distributions

Ubuntu is arguably one of the most popular and widely-used Linux distribution owing to its classic UI, stability, user-friendliness, and a rich repository that contains over 50,000 software packages. Furthermore, it comes highly recommended for beginners who are trying to give a shot at Linux.