You are not logged in.
Hi, when ever I change to root for admin purposes the console returns me to /home/glenn/... (whatever directory i was in before su'ing.)
How do I configure su to always start at / ?
Thank you
pic from 1993, new guitar day.
Online
Hello:
How do I configure su to always start at / ?
See https://files.devuan.org/devuan_beowulf … _notes.txt
Best,
A.
Offline
Thank you for your responce, Altoid.
I see the mention of 'su' and setting the "PATH" when changing, and I have no problem with that as such, I use an alias in ~/.bashrc
And I didn't know that I could change it in /etc/... , Thank you, I may use that.
Actually, I do use that, my alias is commented in ~/.bashrc
And this question is no big deal, but I thought it would look tidy if when 'su'ing if it showed the root directory in the bash prompt.
I use konsole as a terminal mostly when using a GUI.
Could the fix be among the PS1 statements in ~/.bashrc?
this is what I have...
glenn@GamesBox ~ $ su
Password:
root@GamesBox:/home/glenn#
pic from 1993, new guitar day.
Online
Hello:
Thank you ...
You're welcome.
this is what I have...
glenn@GamesBox ~ $ su Password: root@GamesBox:/home/glenn#
Open a terminal and do ...
~ $ cat /etc/default/su
Please post the output.
Best,
A.
Offline
glenn@GamesBox ~ $ cat /etc/default/su
ALWAYS_SET_PATH yes
glenn@GamesBox ~ $
Thank you, but the PATH is not the problem, it's just the look and being in the user directory when I have su'd to root.
I've been looking and hacking the .bashrc file, /etc/profile and /etc/bash.bashrc files and I was mistaken thinking the /w in PS1 may have been the key, but that's not it either.
w.i.p.
Thanks again. regards Glenn
pic from 1993, new guitar day.
Online
Hello:
glenn@GamesBox ~ $ cat /etc/default/su ALWAYS_SET_PATH yes glenn@GamesBox ~ $
Right ...
Now, open the terminal and do ...
~ $ su -
That should get you to /root.
And from there you can cd / to /.
Is that what you meant to do?
Best,
A.
Offline
No, that's what I have to do. But thank you for trying to help me.
Because it's a one user system I only have to cd {enter} to get to /
I was looking or a shorter short cut. :-)
Cheers
pic from 1993, new guitar day.
Online
Hello:
No, that's what I have to do.
I see.
So ...
You want to do su - and be sent directly to / without the cd / bit.
Sorry, it seems that I've reached my pay grade limit. 8^|
... thank you for trying ...
You're welcome.
Best,
A.
Offline
Why not simply use a mini script which only contains one line: cd / && su
Calling that script will bring you to / as root.
The good ol' days will not return, and the rocks might smelt and the sea may burn.
Offline
Or add this line to /root/.profile:
cd /
But you would have to call su - to ensure that the file is read.
Brianna Ghey — Rest In Power
Offline
Or add this line to /root/.profile:
cd /
But you would have to call su - to ensure that the file is read.
So many different ways to avoid simply typing "cd /" each time. Ain't Linux great!?!
Offline
Ain't Linux great!?!
Meh.
Brianna Ghey — Rest In Power
Offline
I know, right. :-)
Thank you for your advise, I got it working.
I added the cd / to /root/.profile
and used
source /root/.profile
but that didn't work, then I tried again with su - and it works.
So, I went back into my ~/.bashrc and uncommented my alias
alias su='su -'
and now it's working.
This box is fully-updated devuan_chimaera_4.0.a
Thank you everybody.
Last edited by GlennW (2021-07-30 22:12:53)
pic from 1993, new guitar day.
Online
andyprough wrote:Ain't Linux great!?!
Meh.
But the author didn't say GNU/Linux sucks. I think they're just referring to systemd/Linux sucking.
Last edited by andyprough (2021-07-31 04:03:05)
Offline
Brianna Ghey — Rest In Power
Offline
Hello:
Yes, I know ...
But old habits die hard, very. 8^/
But thanks for the heads up.
Eventually, I guess.
Best,
A.
BTW:
I see a chap by the name of Andy Tanenbaum has an entry there.
I have not ever been around Unix and have only 10 years or so in Linux.
But reading the page made me wonder: Is this Tanenbaum (genetically or otherwise) related to systemd's Poettering?
Just curious ...
A.
Offline
Hi, I wanted to do this because I don't have sudo enabled and I use su a lot, packaging updates... checking net and kernel logs and such.
I do it a lot and it was just something I thought I could do with my systems, laptop and desktops that would streamline the process for me.
I am very grateful to this community for all the support I get when I can't find a solution to a hack I want to implement.
I don't know much (anything, ... no motive) about real hacking) but try to keep my system as secure as possible and stay current as possible.
But this is mostly because I have disabled sudo that I use su so frequently.
Thank you again (I'll read that link now ...GNU...)
pic from 1993, new guitar day.
Online
I have created my own root terminal according to this description: https://dev1galaxy.org/viewtopic.php?id=2717. This ends up in /root as working directory. The example is for Mate, but it also works with Cinnamon/Gnome terminal.
I guess you can easily set the path to /.
rolfie
Offline