sudo, gksudo, kdesudo and their differences?

26,727

sudo stands for Super User Do. That means it provide privileges of the root/main user via terminal. Learn more about sudo from its official site.
From Vinicius's comment

It originally stood for 'superuser do' as the older versions of sudo were designed to run commands only as the superuser. However, the later versions added support for running commands not only as the superuser but also as other (restricted) users, and thus it is also commonly expanded as 'substitute user do'. Although the latter case reflects its current functionality more accurately, sudo is still often called 'superuser do' since it is so often used for administrative tasks.

gksudo and kdesudo both are also sudo thing except that first one is use for graphical sudo operation which works using GUI instead of terminal and second one is gksudo alternative for Kubuntu.

And a short note from wiki

You should never use normal sudo to start graphical applications as Root.You should use gksudo (kdesudo on Kubuntu) to run such programs. gksudo sets HOME=~root, and copies .Xauthority to a tmp directory. This prevents files in your home directory becoming owned by Root. (AFAICT, this is all that's special about the environment of the started process with gksudo vs. sudo).

Share:
26,727

Related videos on Youtube

SamuelH
Author by

SamuelH

Updated on September 18, 2022

Comments

  • SamuelH
    SamuelH almost 2 years

    What is the difference between sudo, kdesudo and gksudo, and when should I use each? I know that sudo allows me to run both cli and gui functions, but I've seen other people on websites using kdesudo and gksudo for gui functions.

  • Youda008
    Youda008 about 7 years
    su is not 'super user', but 'switch user', the user to switch to is an optional argument, which default valus is root
  • Nabil
    Nabil about 7 years
    @Youda008 AFAIK sudo stands for 'super user do'. If you have any reference add them here please.
  • valkalon
    valkalon about 6 years
    the "man sudo" on Ubuntu will tell you "Execute a command as another user" @Youda008 seems to be right. I guess the "super user do" is a simplification. Anyway, so much for the detail ;)
  • Vinicius
    Vinicius about 6 years
    Just as a curiosity, from Wikipedia: "It originally stood for 'superuser do' as the older versions of sudo were designed to run commands only as the superuser. However, the later versions added support for running commands not only as the superuser but also as other (restricted) users, and thus it is also commonly expanded as 'substitute user do'. Although the latter case reflects its current functionality more accurately, sudo is still often called 'superuser do' since it is so often used for administrative tasks." en.wikipedia.org/wiki/Sudo
  • pdc
    pdc almost 6 years
    I understand with 18.04 that one can no longer do gksu gedit /path/to/file.txt to edit a file, and instead one must now do gedit admin:///path/to/file.txt as discussed here maketecheasier.com/gksu-alternatives-ubuntu-bionic
  • rexkogitans
    rexkogitans about 5 years
    If sudo is somehow related to su, it must be substitute user, according to Wikipedia and the FreeBSD man page of the su command.