What are the differences between sudo, su, visudo, chroot, and gksu?

1

This question already has an answer here:

Can you tell me what the difference is between cat and sudo cat?

All I know so far is that cat is used for displaying contents of file and concatenation.

For a little humour I would say that cat is an animal and sudo cat is a feline with superpowers. :D

sudo is a command that you use to obtain root privileges. root is a special user that manages the machine, and for this he/she has superpowers. For example, if there is a file that only root can see its contents, and you are logged in as a normal user, you can use

$ sudo cat name_of_the_file

to read it. Also if there is a program that only root can run, like the reboot command:

$ reboot warning: must be root! $ sudo reboot rebooting...........

THE CATCH IS: you must be specially (and manually) assigned by root to have permission to use sudo. The permission is given in a file called /etc/sudoers. In Ubuntu, the first user, the one created during...

0 0
2

Linux System is much secured than any of its counterpart. One of the way to implement security in Linux is the user management policy and user permission and normal users are not authorized to perform any system operations.

If a normal user needs to perform any system wide changes he needs to use either ‘su‘ or ‘sudo‘ command.

Linux: su v/s sudo

NOTE – This article is more applicable to Ubuntu based distributions, but also applicable to most of the popular Linux distributions.

‘su’ Vs ‘sudo’

‘su‘ forces you to share your root password to other users whereas ‘sudo‘ makes it possible to execute system commands without root password. ‘sudo‘ lets you use your own password to execute system commands i.e., delegates system responsibility without root password.

What is ‘sudo’?

‘sudo‘ is a root binary setuid, which executes root commands on behalf of authorized users and the users need to enter their own password to execute system command...

0 0
3
Difference between sudo and gksudo James Gilbert jamie.gilbert at gmail.com
Fri Sep 7 10:18:51 BST 2007 Rafael Francisco Compte Mosquera wrote: > Hi, I am kind of a newbie in linux. I like to learn new things and > being a musician it was very stimulating and great challenge (because > I only knew Windows) to wipe out my Windows XP and install > Ubuntustudio 7.04, which I find incredibly powerful. All my knowledge > of linux (which is still very limited) has come from digging dip in > the manuals , help files and forums on the web, and now I think I am > able to do much better when it comes to do the things I need to do > with my computer. As someone else posted "in theory" one should use > gksudo. Why is this? I have used sudo whitout an issue when I needed > to do something as root. But I didn-t know about gksudo. Can anybody > explain the difference? > Thanks, > > Rafael Taken from the man of gksudo: "gksu is a frontend to su and gksudo is a frontend to sudo. Their...
0 0
4

I've been doing more reading trying to understand the differences between using a Debian based Linux vs. using an Arch based Linux.

One thing I came across was this line on a Manjaro help page:

sudo gedit /etc/pacman.conf

In a Debian based Linux, you should use gksudo instead of sudo since gedit is a GUI editor. Sudo would be fine if you were using Vi or Vim as it opens inside the terminal. In a Debian based Linux using sudo would result (I think) in changing ownership of the file you are editing.

However, when looking in the Arch wiki, it seems to make little mention of gksudo, and seeing sudo gedit /etc/pacman.conf on the Manjaro help page makes me think you don't have to worry about changing ownership by using sudo with a GUI editor/program.

Can someone clear me up on this....

0 0
5

On the Linux command line there are many different ways to get a root session in the terminal. This can create some confusion, as most beginner users who are looking to gain root might not be familiar with how each command can gain root access, how they are different and when these differences matter.

It is because of this we will be taking apart each of the many different commands used to gain root access in a terminal. We’ll explain exactly how they gain root, when to use them, and everything in between.

The su command substitutes the current user in use by the system in the shell. You can switch to any user by taking su and adding a username by it. This will tell the system to switch (and essentially log out of) the current user to the one specified. Alternatively, the su command can gain root access by entering su without specifying anything after the command.

“su” is best used when a user wants direct access to the root account on the system. It doesn’t go...

0 0
6

Both files purpose to a similar place:

$ ls -l /usr/bin/gksudo
lrwxrwxrwx one root root four 2010-09-27 18:23 /usr/bin/gksudo -> gksu

... gksudo is symlinked to gksu. however this does not mean they are doing a similar things, off from it.

Applications will notice the command accustomed run it. this is often generally argv[0] in C-style languages or $0 in Bourne-style shell scripts. the applying will look into that and during this case, truly it changes however it works. the primary indication of this is often within the man gksu page:

gksu is a frontend to su and gksudo could be a frontend to sudo.

If you look within the supply (apt-get supply gksu) for run_mode, you will see however it detects this:

run_mode = SUDO_MODE;
g_free (myname);
">

You can override this with the --su-mode/-w and --sudo-mode/-S arguments (so you'll run equivalent commands without having the gksudo symlink... however that is up to...

0 0
7

sudo allows a system administrator to delegate authority to give certain users—or groups of users—the ability to run commands as root or another user while providing an audit trail of the commands and their arguments.

Sudo is an alternative to su for running commands as root. Unlike su, which launches a root shell that allows all further commands root access, sudo instead grants temporary privilege escalation to a single command. By enabling root privileges only when needed, sudo usage reduces the likelihood that a typo or a bug in an invoked command will ruin the system.

Sudo can also be used to run commands as other users; additionally, sudo logs all commands and failed access attempts for security auditing.

Installation

Install the package.

Usage

To begin using sudo as a non-privileged user, it must be properly configured. See #Configuration.

To use sudo, simply prefix a command and its arguments with sudo and a space:

$...
0 0
8

Linux – su vs sudo

For the most Linux distributions, su and sudo are widely used commands. In this article we will discuss what is the main difference between su and sudo commands.


What is ‘su’ command?

‘su’ commands forces you to share your root password to other users. When any superuser type su, it will prompt to enter the root password of the server.

What is ‘sudo’ command?

‘sudo’ is a root binary setuid, which executes root commands on behalf of authorized users and the users need to enter their own password to execute system command followed by sudo. sudo commands makes it possible to execute system commands without root password. Hence you do not require to share your root password to other.

If you do not want to shared your root password, you should add the user to sudoer...

0 0
9

The visudo command is a safe and secure way of editing the /etc/sudoers file on UNIX and Linux systems. Since the sudoers file determines which users can run administrative tasks, those requiring superuser privileges, it is a good idea to take some precautions when editing it, and that's what visudo does.

It locks the sudoers file so it cannot be edited by anyone else simultaneously. It also checks the syntax of your edits and provides basic sanity checks. If someone else is editing the file you'll get a message to try later, and if there are errors in your edits it wont save them.

Preventing simultaneous editing by someone else is helpful to ensure your edits aren't lost, and saving a sudoers file without errors is important because you could otherwise end up locked out of your system. An unreadable sudoers file will prevent you from running administrative tasks by using the sudo command or becoming root, and editing the sudoers file itself requires those privileges....

0 0
10
...
0 0
11

Background Information

In Linux (and Unix in general), there is a SuperUser named Root. The Windows equivalent of Root is Administrators group. The SuperUser can do anything and everything, and thus doing daily work as the SuperUser can be dangerous. You could type a command incorrectly and destroy the system. Ideally, you run as a user that has only the privileges needed for the task at hand. In some cases, this is necessarily Root, but most of the time it is a regular user.

By default, the Root account password is locked in Ubuntu. This means that you cannot login as Root directly or use the su command to become the Root user. However, since the Root account physically exists it is still possible to run programs with root-level privileges. This is where sudo comes in – it allows authorized users (normally “Administrative” users; for further information please refer to AddUsersHowto) to run certain programs as Root without having to know the root...

0 0
12

About visudo

visudo edits the sudoers file, which is used by the sudo command. To change what users and groups are allowed to run sudo, run visudo.

If the user running sudo does not meet the authentication configuration in sudoers, they are denied permission to run a command with escalated privileges.

You should not edit sudoers directly, by opening it in a text editor. Instead, edit it with visudo, which will verify its validity before saving the changes to disk.

Description

visudo edits the sudoers file in a safe fashion, similar to the way that the vipw command safely edits the passwd file. visudo locks the sudoers file against multiple simultaneous edits, provides basic sanity checks, and checks for parse errors. If the sudoers file is currently being edited by someone else, or by you in another session, you will receive a message to try again later.

There is a hard-coded list of one or more editors that visudo will use, set at...

0 0