Tiny Core Base > TCB Q&A Forum

Now 'sudo su' in /root

(1/7) > >>

hjkl:
Hi,

b34a6ad48638bd082727c8053923d5c9  tinycore_1.0rc4.iso

I open a terminal on TinyCore and 'sudo su'.  Now, I get "root@box:~#" and become a root user
in "/root".  Before the change, 'sudo su' gave me "root@box:/home/tc#" and used "/home/tc" directory.
I know this is not a bug because I also noticed a change in JWM's menu.

From the menu:

(new: root@box:~#)
aterm -cr red -T "Root Shell" -e sudo su

(old: root@box:/home/tc#)
aterm -cr red -T "Root Shell" -e sudo /bin/sh

I got used to the "old" behavior, so I would like to know why this change is better
than the other one.

tobiaus:
both are home directories, it's the same as cd ~ ... /home/tc is user tc's home, /root is user root's home.

it makes less sense if you are root to be in another user's home directory.

hjkl:
Hi tobiaus,

I see what you mean.  Then, I wonder why we kept the other way for a long time.
If I am not mistaken, the "old" behavior goes back beyond DSL-2.0.
Well, I think I have to get rid of my old habit.

Thanks for the reply.

^thehatsrule^:
hjkl: I agree with your first post.

`sudo su` should not change dirs because it should retain most of the calling user's environment (unless it was made to do so explicitly, ie in sudoers, or a login shell).  I'm not sure what change caused this.

I was comparing 1.0 rc3 and rc4 and did not notice a difference between the jwm menus though (~/.jwmrc)

mikshaw:
As I see it, using su from within an existing  terminal should never change the directory, and shouldn't change the environment unless you do "su -".  Maybe that's not how su was officially designed, but that's what I think it was designed to do, and that's what makes sense to me.


--- Quote ---(new: root@box:~#)
aterm -cr red -T "Root Shell" -e sudo su

(old: root@box:/home/tc#)
aterm -cr red -T "Root Shell" -e sudo /bin/sh

I got used to the "old" behavior, so I would like to know why this change is better
than the other one.
--- End quote ---

The above change is partly logical to me.  Opening a root shell from a menu item should use the root user's chosen shell.  The old version used /bin/sh regardless of what root's shell happens to be (assume the shell may have been changed to bash or zsh or whatever else).

I'm not so sure about " root@box:~#".  I don't have a problem with it, but I don't understand why or how the root shell is opening in /root.  Typically a new shell opens within whatever directory  you were in when you opened it, regardless of what HOME is.

Navigation

[0] Message Index

[#] Next page

Go to full version