Differences between Terminal Konsole and Terminal - Super User Mode

I would like to know the differences between Terminal Konsole and Terminal - Super User Mode (the one with the red terminal icon).
Why would I need Terminal - Super User Mode when I can become super user from Terminal Konsole with the su command?

Thanks in advance/
larilund

i just su/sudo.

On Sun, 29 Jul 2012 18:06:02 +0000, larilund wrote:

> Why would I need Terminal - Super User Mode when I can become super user
> from Terminal Konsole with the su command?

Convenience.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

On 07/29/2012 08:06 PM, larilund wrote:
>
> I would like to know the differences between Terminal Konsole and
> Terminal - Super User Mode

no difference .=EXCEPT=.

  1. Terminal - Super User Mode moves you (a normal user) to root’s
    environment, as well as giving you root powers…while

  2. in Konsole the command “su” gives you root powers BUT you do not take
    on root’s environment

try it! open Konsole and issue “su” and you end with a red prompt (root
power) in your own home (/home/[yourID]/)…BUT, click the Terminal -
Super User Mode icon, give the root password and it opens in root’s home
(/root/)

magic!

so, to become root and take on root’s environment in konsole (or any
user terminsl) issue not “su” but “su -”

and, CAREFUL because sudo is only a half step also…leaving you with a
users environment AND some subset of roots full powers (depending on how
you set up sudoers)

it is for these reasons that that this how-to “Become su in Terminal -
HowTo” is written as it is: http://tinyurl.com/ydbwssh

btw, things can (and do) go wrong if you need to be root, and only use
su (and not “su -”) to try to get to actually being root…


dd http://tinyurl.com/DD-Caveat

Your best bet is to use a normal Terminal session and use sudo if you need to. Since sudo does not change your environment (or path), some commands like fdisk, will not be found in your default path and require the folder and program name to work such as:

sudo /sbin/fdisk -l, works OK

but

sudo fdisk -l, does not work because fdisk is not in your path.

You can use su - to become root in terminal, but it has all the problems of starting a terminal session as root, so be careful when using that.

Thank You,

It is the equivalent of doing

su -

And yes, it is convenient because:
a) it lets you not err in forgeting the - of su -, which is important from several security/convenience points of view (and I see you made the same error in your post);
b) it lets you have this in a different colour scheme to draw your attention to the fact hat this is root and thus a dangerous place to be;
c) more?

You should su - or **su -l ** … or add some directories, such as /sbin and /usr/sbin to your PATH.
See @jdmcdaniel3’s post above!

this is an interesting point… i don’t recall ever having to qualify a full path for /sbin /usr/sbin while in su/sudo. is this a recent linux development, a suse thing, or is my memory just gone on this point? I come from more of a FreeBSD background.

I don’t need to use full path either, but I have /sbin and /usr/sbin in my PATH as user. Most people don’t, as it is not the default under (any) Linux. That’s also the reason why I sometimes post advice here which don’t work for other people, because I always forget that. :frowning:

Me too btw. But I set my PATH under BSD as well. So I’m not sure what’s the default.

accidental double post

@mr0z

I am not sure if it is solely a suse thing, but I know debian does not require /sbin/command when I use sudo.

please_try_again;2477182]I don’t need to use full path either, but I have /sbin and /usr/sbin in my PATH as user. Most people don’t, as it is not the default under (any) Linux. That’s also the reason why I sometimes post advice here which don’t work for other people, because I always forget that. :frowning:

I just replaced a faulty drive in my macbook a couple days back and dual booted SuSE… so setup is still underway. Appending sbin’s to PATH is a good idea and up next :slight_smile: I actually haven’t used SuSE since my time with 6.0.

Me too btw. But I set my PATH under BSD as well. So I’m not sure what’s the default.

I can’t recall off the top of my head what the default was either. Solid OS though!

I don’t think RHEL needed it either at my previous job. Oh well… as I mentioned above, SuSE has a nostalgic feel for me, so discovering it’s little nuances is a pleasure

Look at the value of secure_path in /etc/sudoers under Debian. It probably includes /usr/sbin and /sbin.

Yes, I would assume so. I was just mentioning that it was not the default on debian derived distros. (Personally I do not mind it either way, guess it is all what you are used to)

I was talking about the user path, not about sudo path. Not the same thing.

Now are you losing me. The only path I know is where the shell looks for executables. I had to toy with that when an upgrade broke for me on debian once.

There is ENV_PATH for regular users and ENV_ROOTPATH for superuser in login.defs. But the latter is an “opensusism”. In all other distros, it is called ENV_SUPATH. There are often overwritten in user’s and root’s login profile. There is also secure_path for sudoers, which is set by default under Debian but not openSUSE… Hmm, actually not. I see it under Ubuntu, but not Debian nor Mint. Anyway, the search path for executables may be different when you precede a command with sudo. You can actually see the full path with :

$ sudo -l <command>

and display the sudo path with

$ sudo -l | grep secure_path

But it won’t print anything under openSUSE, since it is not set by default.

So there are several different paths that can be searched when you enter a command :

  • The users’ path (defined in the shell initialization files) when you type for example:
$ fdisk -l
  • The sudo path (set in /etc/sudoers) when you type
$ sudo fdisk -l 
  • the path defined in ENV_SUPATH (ENV_ROOTPATH under openSUSE) when you type:
$ su -c 'fdisk -l'
  • and the path set in root’s environment when you type:
$ su -
# fdisk -l

Correct me if I’m wrong (I might, because I’m doing too many different things at the same time, as usual).

On 07/30/2012 03:26 AM, mr0z wrote:
> i don’t recall ever having to qualify a
> full path for /sbin /usr/sbin while in su/sudo. . . a suse thing

as far as i know (not so far) su/sudo may grant full root environment
(including root’s path–which does include /sbin and /usr/sbin) in [some
| many | all] other distros

OR other distros include /sbin and /usr/sbin in a users path…

i don’t remember which or when, but i had to either “relearn” how it
worked here or jimmy the user’s path as please_try_again does–but, i
stopped “fixing” my path because i also found myself giving advice here
which another user could not use because the other user’s path was
likely to be the unfixed “SUSE default”, like mine:

denverd@linux-os114:~> echo $PATH
/home/denverd/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/jvm/jre/bin

so, i count the answer to your question to be: it is an openSUSE [and
SLE_] thing…


dd

I have a strong personal (well, not so personal because many good Unix system administators feel the same) opinion about this.

You should allways use* su - (or su -l). I am not good at searching these forums, but there are numerous threads about su vs. su -* in these forums and at least one includes an example of what can go wrong not using su -.

You should not add* /sbin *and /usr/sbin to the PATH of an end-user. The tools there are not for end-user usage.

The tool sudo is for somethiing completly different. It is misconfigured in openSUSE (as Carlos allready showed not long ago) and consequently misused by system adminstrators in openSUSE. It seems that this is to be more coompatible with other Linux distributions. Of course I will not encourge this misusage, but it is save enough.

There is a documentation about this in SDB:Login as root - openSUSE It needs a bit of an update (Dolphin is now the KDE filemanager and not Konqueror), but the mnessage is clear enough. In short:

  • the big NONO: never run a GUI session as root
  • for CLI usage as root
    use su - - for starting a GUI program as root use kdesu
    or gnomesu - you can of course use shortcuts to these in the main menu (start xxx in superuser mode, or how it is expressed)