You are not logged in.
cant run commands
fdisk -l
and other, but
--help and pwd
runs find
what is my problem ?
Last edited by devur (2020-06-06 16:31:03)
Laptop lenovo
Desktop XFCE
Os Devuan GNU/Linux
Offline
Hi
Hopefully you can log in as root ;-)). If not try "sudo passwd root" to get access.
The behavior of su to root has changed in bewulf (se the releasse notes!!). To get full path you need "su -" or "su root". It is supposed to be more secure.
Have a nice day
Lars H
Offline
hi and thank for your answer, it dos not get me all the way I haw root but still no commands?
su
Adgangskode:
root@devuan:/home/hans# fdisk -l
bash: fdisk: kommand not found
root@devuan:/home/hans#
Laptop lenovo
Desktop XFCE
Os Devuan GNU/Linux
Offline
I'm a bit confused.. Is is only fdisk you cannot run? Or is there other commands as well that does not work?
Maybe this is related to fdisk for you:
https://dev1galaxy.org/viewtopic.php?id=3547
Could you do apt-get install fdisk and post what it says?
Last edited by climbingturtle (2020-06-06 15:36:23)
Offline
Hej
Du får det på dansk. Du skal ikke kun skrive su men "su -" ellers har du kun adgang til bruger rettigeheder ikke login som root.
Hello
Written in danish. To get full root access you need to write not just "su" but "su -"
Have a nice day
Lars H
Offline
Could you do apt-get install fdisk and post what it says?
fdisk is up to date
fdisk er allerede den nyeste version (2.33.1-0.1+devuan1~beowulf2).
0 opgraderes, 0 nyinstalleres, 0 afinstalleres og 0 opgraderes ikke.
and the use of login
"su -"
gets me all the way
thanks for your help
Laptop lenovo
Desktop XFCE
Os Devuan GNU/Linux
Offline
Can't reproduce this "su -" thing
su-
bash: su-: Kommando nicht gefunden.
command not found
su -
-bash: ash: Kommando nicht gefunden.
command not found
Man-pages say:
Es wird empfohlen, stets die Option --login (statt deren
Kurzform -) zu verwenden
means"--login" recommended instead of shortform "-"
BUT
if I use
su --login
I get a root-shell without filling in my password!
Passwort:
-bash: ash: Kommando nicht gefunden
Sic!
~# whoami
root
I would suggest to put the thread again to
not solved
and inform security
Offline
Hi
When you login (su) as root you need to login with "su -" su + empty space and then - to get root with full path. It is not a bug but a deliberate change from debian.
Have an nice day
Lars H
Last edited by larsH (2020-06-26 09:05:51)
Offline
btw
I had similar problems with installed programs (since Beowulf) as i.e. "dmidecode"
invoking "dmidecode" led to "program not found".
But
apt-get install dmidecode
led to
dmidecode ist schon die neueste Version (3.2-1)
meaning "is already the newest version"
Here's the kicker:
after updating no difference
but after reboot dmidecode worked as it should!
Bug or feature?
Offline
Hi LarsH,
well if you read my post, you can see that
su -
is not working on my Beowulf.
Distro: Devuan GNU/Linux 3 (beowulf)
If I use the recommended long form
su --login
I even get a root-shell without a password.
And you are writing:"it is not a bug but a deliberate change from debian."
Well if that is so it must be changed again!
I don't want debian stuff of that nature!
Last not least: "su" ist still working on my PC as usual!
Warmest regards
Offline
In your post #7, it looks like your attempts with "su" fails because "ash" is not found, which suggests that "ash" is wanted to be used by the initial file(s) that are loaded at login, but is found missing. It looks odd, and maybe you should check up on that first, i.e. specifically why do you get the output:
bash: ash: Kommando nicht gefunden
Just in parenthesis, regardless of your recent experiences, the program su works perfectly fine in beowulf, and it is directly brought in from debian buster. Though, it works differently from how it worked some time period ago, when its juggling of environment variables was different.
Online
Hi Ralph,
thanks for the answer!
1)
Well my "su" still works fine. I was a bit of confused that I should work from now on with "su -". But I tried it with "command not found" result.
Why should I check up why "su -" is not working, when "su" is working as usual? Btw I have no idea how to check up why I get that "ash" output.
Any suggestions?
2)
Being able as normal user to get a root-shell by just typing su "--login" without need for a password makes me a little nervous.
Not you?
greetings
Offline
I was a bit of confused that I should work from now on with "su -".
It's just another upstream solution in search of a problem.
'su' no longer adds /sbin and /usr/sbin to your $PATH, so you will get "command not found" for any binaries that live there.
'su -' or 'su --login' will read root's profile, so you get root's $PATH, which does include /sbin and /usr/sbin.
Stick alias su='su -' in your ~/.bash_aliases and forget about it.
I have no idea how to check up why I get that "ash" output.
Any suggestions?
Sounds like some cruft in root's .profile / .bashrc etc?
What does env say after you su to root, and what's in root's .bashrc, .profile, .bash_profile and .bash_aliases (if they exist)?
Being able as normal user to get a root-shell by just typing su "--login" without need for a password makes me a little nervous.
Not you?
Smells like a pam screwup to me (assuming it's not some new and wonderful default).
What do /etc/pam.d/su and /etc/pam.d/su-l contain?
You should not be able to su of any kind without a password unless you are already root, or you have something like "auth sufficient pam_<something>.so trust" in your pam su config, which would be very silly.
Last edited by steve_v (2020-06-26 11:01:01)
Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.
Offline
Hi Steve, ptmy!
~# printenv
SHELL=/bin/bash
PWD=/root
LOGNAME=root
HOME=/root
LANG=de_DE.UTF-8
TERM=xterm-256color
USER=root
SHLVL=1
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
MAIL=/var/mail/root
_=/usr/bin/printenv
.bashrc:
HISTSIZE=100
HISTCONTROL=ignoredups:erasedups
.profile
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
mesg n || true
.bash_profile does not exist
.bash_aliases
alias su='su -'
/etc/pam.d/su
@include common-auth
@include common-account
@include common-session
/etc/pam.d/su-l
#%PAM-1.0
auth include su
account include su
password include su
session optional pam_keyinit.so force revoke
session include su
Thanks
greetings
Offline
Firstly you might test by using ctrl-alt-f1 to shift to VT-1 and log in as root. Does that result in the same experience as your su --login, i.e. blank password is fine, and then bash complains about ash?
Online
Hi Steve
...
Well that all looks fine. Rats.
Does the root account actually have a password?
Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.
Offline
@steve
yes, there is a root password!
@ralph
I can't reproduce the problem anymore (puuh, saved)
su -
su --login
and
su
all demand a password. (Everywhere, also on a non grafic console. "ctrl-alt-f1").
Sent securrity home again.
-----------------------------------
su -
and
su --login
with output
-bash: ash: Kommando nicht gefunden.
(command not found)
-----------------------------------------------------
Only
su
(after setting alias)
alias su='su -'
does NOT output
-bash: ash: Kommando nicht gefunden.
but silently opens a root-shell
root@someone:/home/someone#
------------------------------------------------------
Remains the "ash output".
Couldn't find much in the web:
https://en.wikipedia.org/wiki/Almquist_shell
https://www.in-ulm.de/~mascheck/various/ash/
which leaves me as ignorant as before.
greetings
Offline
FWIW, /bin/ash can be symlinked to /usr/bin/busybox to use the provided shell for that tool.
Are you sure the posted .bashrc & .profile were from /root/? The alias would suggest that they were from your user's home directory, which would not be read for a root login.
Brianna Ghey — Rest In Power
Offline
@Head_on_a_Stick:
"su" without argument
works fine
Yes .bashrc and .bash_aliases are those from root
GNU nano 3.2 /root/.bashrc
# eval "`dircolors`"
# alias ls='ls $LS_OPTIONS'
# alias ll='ls $LS_OPTIONS -l'
# alias l='ls $LS_OPTIONS -lA'
#
# Some more alias to avoid making mistakes:
# alias rm='rm -i'
# alias cp='cp -i'
# alias mv='mv -i'
HISTSIZE=1000
HISTCONTROL=ignoredups:erasedups
GNU nano 3.2 /root/.bash_aliases
alias su='su -'
But I overlooked three lines out commented in /etc/pam.d/su:
# This allows root to su without passwords (normal operation)
auth sufficient pam_rootok.so
session required pam_env.so readenv=1 envfile=/etc/default/locale
session optional pam_mail.so nopen
session required pam_limits.so
greetings
Offline
To finish that
bash:ash: command not found
thing:
I just added an empty "ash"-file in /bin.
Since then there are no more errors like
bash:ash: command not found
If anyone has an better idea or just can explain to me where that error message came/comes from;
you are very welcome!
I found no hint in .bashrc of any script or program that needs ash.
greetings
Offline
To finish that
bash:ash: command not found
thing:
I just added an empty "ash"-file in /bin.Since then there are no more errors like
bash:ash: command not found
If anyone has an better idea or just can explain to me where that error message came/comes from;
you are very welcome!I found no hint in .bashrc of any script or program that needs ash.
greetings
The error message is coming from bash - the command providing the error is the first word in the error message. You get 'command not found' if ash is not installed. If you're sure you installed it, then something weird is going on or you didn't notice when it got removed.
If you create an empty /bin/ash, you should then get 'permission denied' because it's not executable. If you make it executable, then the error messages go away, but of course it does nothing.
A few messages above, you said 'ash' gives you a root shell after aliasing 'su'. The prompt that you pasted is a bash prompt. The ash prompt is just # or $ for root or user, respectively.
Note: You can also get 'command not found' with the new default su setup if the command you're trying to run is in an sbin directory and you used 'su' instead of 'su -'. Your alias works around this.
Offline
@fsmithred
thanks for answering ...
sorry, I found out that ash was NOT installed. So I installed it (again? I am really not quite shure)
I don't remember exactly what kind of prompt-behaviour I had, before I did that su alias.
Before installing ash I deleted that empty ash file.
/bin looks like this now:
ls -l *ash
lrwxrwxrwx 1 root root 4 Jan 17 2019 ash -> dash
-rwxr-xr-x 1 root root 1168776 Apr 18 2019 bash
-rwxr-xr-x 1 root root 121464 Jan 17 2019 dash
lrwxrwxrwx 1 root root 4 Apr 18 2019 rbash -> bash
NOW opening a console, I get:
ash: 0: Can't open completion
Offline
I m sitting on fresh installed Beowulf. No ash, just bash, dash and bash-completion. No problems.
Have you got bash-completion installed?
I am not using the alias.
rolfie
Offline
bash-completion ist schon die neueste Version (1:2.8-6).
is already newest version
greetings
Offline
My /bin/*ash looks the same as yours after I install ash. I don't get an error message when I start an ash shell. I'm starting the shell by running 'ash' in xfce4 terminal. How are you doing it? How did you install the system? What did you do that's different from everyone else?
I'm not finding that error message on a web search. (Can't open completion)
Offline