Hallo
Schau mal hier:
https://askubuntu.com/questions/214539/opening-terminal-asks-for-sudo-password
Vielleicht hilft Dir das weiter.
Hallo
Schau mal hier:
https://askubuntu.com/questions/214539/opening-terminal-asks-for-sudo-password
Vielleicht hilft Dir das weiter.
Ich habe da so eine Vermutung... ( bin mir aber nicht so sicher )
wenn der Benutzer sudo-Rechte bekommt , muss das im der folgende Config-datei drin stehen:
/etc/sudoers
D.h. der Benutzer muss in der Gruppe wheel drin sein.
Es kann sein dass du mit dem Befehl
passwd -L root
dem Root-User "sozusagen" die Rechte entzogen hast und damit den normalen User die eingabe des sudo erzwingst....
Aber wie gesagt: Es ist nur eine Vermutung
Nachtrag: Zwei Links dazu zum Lesen:
https://wiki.archlinux.org/title/users_and_groups
https://man.archlinux.org/man/passwd.1.en
SUSEDJAlex wenn der Benutzer sudo-Rechte bekommt , muss das im der folgende Config-datei drin stehen:
/etc/sudoers
D.h. der Benutzer muss in der Gruppe wheel drin sein.
Jein.
SUSEDJAlex Es kann sein dass du mit dem Befehl
passwd -L root
dem Root-User "sozusagen" die Rechte entzogen hast und damit den normalen User die eingabe des sudo erzwingst....
Die Option -L
finde ich nicht. Und passwd
ändert keine Rechte, sondern Passwörter. Aber steht alles in man 1 passwd
. Könnte man natürlich lesen.
@Gerry_Ghetto
Drum habe ich ja auch geschrieben => bin mir nicht sicher....
Vielleicht erstmal von vorne Anfangen.
whoami
dann
id
uid ist?
welche Gruppen werden angezeigt...
Ich schließe mich hier an:
Gerry_Ghetto Irgendetwas in der .bashrc oder .zshrc "optimiert"?
Zeig doch mal die ~/.bashrc und die ~/.bash_profile.
Ansonsten wäre es hilfreich du führst ein
useradd -m -G users,wheel -s /bin/bash <neuer-benutzer>
aus und meldest dich als neuer Benutzer an.
Wenn ich einen neuen User anlege, so existiert das Problem nicht.
Ich nutze zsh. Also hier meine ~/.zshrc:
[ACHTUNG - EDIT: das "->" steht für das Kommentarzeichen nur hier im Ausdruck, da
das reale Kommentarzeichen hier im Forum die Schrift nur überdimensional vergrößert
und nicht angezeigt wird]
--
-> If you come from bash you might have to change your $PATH.
-> export PATH=$HOME/bin:/usr/local/bin:$PATH
-> Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
-> Set name of the theme to load --- if set to "random", it will
-> load a random theme each time oh-my-zsh is loaded, in which case,
-> to know which specific one was loaded, run: echo $RANDOM_THEME
-> See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
->ZSH_THEME="robbyrussell"
ZSH_THEME="jonathan"
-> Set list of themes to pick from when loading at random
-> Setting this variable when ZSH_THEME=random will cause zsh to load
-> a theme from this variable instead of looking in $ZSH/themes/
-> If set to an empty array, this variable will have no effect.
-> ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
-> Uncomment the following line to use case-sensitive completion.
-> CASE_SENSITIVE="true"
-> Uncomment the following line to use hyphen-insensitive completion.
-> Case-sensitive completion must be off. _ and - will be interchangeable.
-> HYPHEN_INSENSITIVE="true"
-> Uncomment the following line to disable bi-weekly auto-update checks.
-> DISABLE_AUTO_UPDATE="true"
-> Uncomment the following line to automatically update without prompting.
-> DISABLE_UPDATE_PROMPT="true"
-> Uncomment the following line to change how often to auto-update (in days).
-> export UPDATE_ZSH_DAYS=13
-> Uncomment the following line if pasting URLs and other text is messed up.
-> DISABLE_MAGIC_FUNCTIONS="true"
-> Uncomment the following line to disable colors in ls.
-> DISABLE_LS_COLORS="true"
-> Uncomment the following line to disable auto-setting terminal title.
-> DISABLE_AUTO_TITLE="true"
->->-> Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="true"
-> Uncomment the following line to display red dots whilst waiting for completion.
-> Caution: this setting can cause issues with multiline prompts (zsh 5.7.1 and newer seem to work)
-> See https://github.com/ohmyzsh/ohmyzsh/issues/5765
-> COMPLETION_WAITING_DOTS="true"
-> Uncomment the following line if you want to disable marking untracked files
-> under VCS as dirty. This makes repository status check for large repositories
-> much, much faster.
-> DISABLE_UNTRACKED_FILES_DIRTY="true"
-> Uncomment the following line if you want to change the command execution time
-> stamp shown in the history command output.
-> You can set one of the optional three formats:
-> "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
-> or set a custom format using the strftime function format specifications,
-> see 'man strftime' for details.
-> HIST_STAMPS="mm/dd/yyyy"
-> Would you like to use another custom folder than $ZSH/custom?
-> ZSH_CUSTOM=/path/to/new-custom-folder
-> Which plugins would you like to load?
-> Standard plugins can be found in $ZSH/plugins/
-> Custom plugins may be added to $ZSH_CUSTOM/plugins/
-> Example format: plugins=(rails git textmate ruby lighthouse)
-> Add wisely, as too many plugins slow down shell startup.
plugins=(git)
source $ZSH/oh-my-zsh.sh
-> User configuration
-> export MANPATH="/usr/local/man:$MANPATH"
->->-> You may need to manually set your language environment
export LANG=de_DE.UTF-8
-> Preferred editor for local and remote sessions
-> if [[ -n $SSH_CONNECTION ]]; then
-> export EDITOR='vim'
-> else
-> export EDITOR='mvim'
-> fi
-> Compilation flags
-> export ARCHFLAGS="-arch x86_64"
-> Set personal aliases, overriding those provided by oh-my-zsh libs,
-> plugins, and themes. Aliases can be placed here, though oh-my-zsh
-> users are encouraged to define aliases within the ZSH_CUSTOM folder.
-> For a full list of active aliases, run `alias`.
->
-> Example aliases
-> alias zshconfig="mate ~/.zshrc"
-> alias ohmyzsh="mate ~/.oh-my-zsh"
->list
alias ls='ls --color=auto'
alias la='ls -a'
alias ll='ls -alF'
alias l='ls'
alias l.="ls -A | egrep '^\.'"
->fix obvious typo's
alias update="sudo pacman -Syyu"
alias upboot="sudo pacman -Syyu && shutdown -r 5"
alias updown="sudo pacman -Syyu && shutdown +5"
alias down='shutdown +5'
alias install="sudo pacman -S"
->-> Colorize the grep command output for ease of use (good for log files)->->
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
->readable output
alias df='df -Th'
->pacman unlock
alias unlock="sudo rm /var/lib/pacman/db.lck"
alias rmpacmanlock="sudo rm /var/lib/pacman/db.lck"
->free
alias free="free -mt"
->use all cores
->alias uac="sh ~/.bin/main/000*"
->continue download
alias wget="wget -c"
->userlist
alias userlist="cut -d: -f1 /etc/passwd"
->merge new settings
alias merge="xrdb -merge ~/.Xresources"
-> Aliases for software managment
-> pacman or pm
alias pacman="sudo pacman --color auto"
alias update="sudo pacman -Syyu"
alias clean="pacman -Rsn $(pacman -Qdtq)"
->ps
alias psa="ps auxf"
alias psgrep="ps aux | grep -v grep | grep -i -e VSZ -e"
->back to bash
alias tobash="sudo chsh $USER -s /bin/bash && echo 'Now log out.'"
->hardware info --short
alias hw="hwinfo --short"
->check vulnerabilities microcode
alias microcode='grep . /sys/devices/system/cpu/vulnerabilities/*'
->get fastest mirrors in your neighborhood
alias mirror="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist"
alias mirrord="sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist"
alias mirrors="sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist"
alias mirrora="sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist"
->youtube
alias yta-aac="yt-dlp --extract-audio --audio-format aac "
alias yta-best="yt-dlp --extract-audio --audio-format best "
alias yta-flac="yt-dlp --extract-audio --audio-format flac "
alias yta-m4a="yt-dlp --extract-audio --audio-format m4a "
alias yta-mp3="yt-dlp --extract-audio --audio-format mp3 "
alias yta-opus="yt-dlp --extract-audio --audio-format opus "
alias yta-vorbis="yt-dlp --extract-audio --audio-format vorbis "
alias yta-wav="yt-dlp --extract-audio --audio-format wav "
alias ytv-best="yt-dlp -f bestvideo+bestaudio "
->Recent Installed Packages
alias rip="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -200 | nl"
alias riplong="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -3000 | nl"
->iso and version used to install ArcoLinux
alias iso="cat /etc/dev-rel | awk -F '=' '/ISO/ {print $2}'"
->get the error messages from journalctl
alias jctl="journalctl -p 3 -xb"
->nano for important configuration files
->know what you do in these files
alias nlightdm="sudo nano /etc/lightdm/lightdm.conf"
alias npacman="sudo nano /etc/pacman.conf"
alias nmkinitcpio="sudo nano /etc/mkinitcpio.conf"
alias nslim="sudo nano /etc/slim.conf"
-> alias noblogout="sudo nano /etc/oblogout.conf"
alias nmirrorlist="sudo nano /etc/pacman.d/mirrorlist"
->->Ausgabe von Fehlermeldungen beim Start
alias err="sudo dmesg -T -l err"
->->Dolphin als root
-> alias doroot="pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true dolphin"
->->gpg
->->verify signature for isos
->alias gpg-check="gpg2 --keyserver-options auto-key-retrieve --verify"
->->receive the key of a developer
->alias gpg-retrieve="gpg2 --keyserver-options auto-key-retrieve --receive-keys"
alias key="pacman -Sy archlinux-keyring"
->systeminfo
alias probe="sudo -E hw-probe -all -upload"
->shutdown or reboot or 90
alias ssn="sudo shutdown now"
alias sr="sudo reboot"
alias sh60="shutdown +60"
alias sh90="shutdown +90"
alias sh100="shutdown +100"
alias sh120="shutdown +120"
->Playlist einer CD
alias inhalt="ls > _play.m3u"
neofetch | lolcat
->-> source /home/arya/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
Moderativer Edit: Großere Codebereiche bitte in Codeblöcken posten. Ich habs mal angepasst.
Gruppe 1000 autologin sieht komisch aus. Welchen Installer hast du denn verwendet, um Arch zu installieren?
Installer? Hey Arch habe ich Old School mäßig übers Terminal mit Hilfe des Installation Guides (https://wiki.archlinux.org/title/Installation_guide) im Juli 2021 installiert.
"Installer benutzen nur ubuntu- und linuxmintuser" ^^
AryA Beim Anlegen eines neuen Benutzers existiert das Problem nicht.
Nutze zsh mit ohmyzsh als Erweiterung.
Also liegt die Ursache in deinem $HOME.
Nächster sinnvoller Test wäre (am sichersten ohne als User eingeloggt zu sein, z.B. als root)
Benenne deine $HOME/.zshrc um z.B. nach .zshrc.bak und mache dann einen Login an einem TTY.
Tritt das Problem nicht mehr auf, dann ist es die .zshrc.
Glaub ich aber nicht, da daß Problem ja scheinbar nur bei Login-Shells auftritt.
//Edit3: Gerade das Eingangspost nochmal gelesen, das Problem tritt ja scheinbar bei jedem Start der Shell, also auch mit einem "normalen" Terminal. Dann also zu 94,68% die .zshrc (und eben der
schard ohmyzshit-Kram
ROFL... //Edit-Ende
Deshalb poste doch auch nochmal (sofern vorhanden):
$HOME/.zprofile
$HOME/.zlogin
//Edit: Bzw. teste analog zu obigem jeweils mit einer "frischen"/leeren .zprofile/.zlogin.
Anmerkung: für "anständige" Ausgaben im Forum nutze bitte die Code-Funktion.
Einzeiliger Codeblock wird in Single-Backticks umschlossen, mehrzeiliger von jeweils drei Backticks welche jeweils in einer eigenen Zeile stehen müssen. Am besten den zu "codierenden" Text markieren und die Code-Funktion unten in der Editierfunktionszeile "</>" nutzen.
//Edit2: Du hast in deiner .zshrc einen Alias namens "install" gesetzt. Das ist aber auch gleichzeitig ein "richtiges" Programm in /usr/bin/install. Solche Aliase solltest du vermeiden, früher oder später führt das zu Problemen. Eine Möglichkeit ist z.B. konsequente Nutzung eines Präfix, z.B. <INITIALEN>_install.
Bei so vielen Aliasen mit sudo drin würde es mich nicht wundern, wenn der ohmyzshit-Kram irgendein Kommando aufruft, dass überschreiben wurde und dadurch der Sudo Prompt zustande kommt. Daher würde ich mal alle Aliase auskommentieren und, wenn dies das Problem behebt, sukzessive einkommentieren, um den Täter zu isolieren.
Auch den neofetch Call finde ich verdächtig und würde auch den mal auskommentieren.
Vielleicht mal dann, wenn sudo
die Aufforderung zur Authentifizierung anzeigt vor der Beantwortung auf einem anderen Terminal als Benutzer mit ps -Af|grep sudo
sich anzeigen lassen, welcher Prozess die erweiterten Rechte anfordert.
Wenn die Anforderung bereits beatwortet wurde, wird (als root) im Journal unter anderem mit dem Eintrag COMMAND=
dokumetiert, welcher Befehl die Rechte angefordert hat.
Martin-MS Wenn die Anforderung bereits beatwortet wurde, wird (als root) im Journal unter anderem mit dem Eintrag COMMAND=dokumetiert, welcher Befehl die Rechte angefordert hat.
Den Ansatz mag ich. Terminal öffnen, sudo bestätigen und dann bspw. mit dem Command journalctl --since today _COMM=sudo
schauen, welcher Befehl zuletzt mit sudo ausgeführt wurde.
Ich nicht so… denn man beantwortet blind eine sudo
-Anforderung ohne zu wissen, woher sie kommt. Es könnte ja auch ein Schadprogramm sein, das sich erweiterte Zugriffsrechte verschaffen möchte. Ich präferiere deshalb die erste Variante, den Prozess ausfindig zu machen bevor man ihm über sudo
weitere Rechte gewährt.
Martin-MS Ich nicht so… denn man beantwortet blind eine sudo-Anforderung ohne zu wissen, woher sie kommt. Es könnte ja auch ein Schadprogramm sein, das sich erweiterte Zugriffsrechte verschaffen möchte. Ich präferiere deshalb die erste Variante, den Prozess ausfindig zu machen bevor man ihm über sudo weitere Rechte gewährt.
In diesem Fall ist der Zug doch schon längst abgefahren 😃
Aber grundsätzlich hast du natürlich Recht.
Vielen lieben Dank an alle, die sich meines Problems angenommen haben...mit dem
ps -Af|grep sudo
habe ich den Fehler in der ~/.zshrc gefunden. Ursache waren diese beiden Zeilen:
alias pacman="sudo pacman --color auto"
alias clean="pacman -Rsn $(pacman -Qdtq)"
Noch einmal ganz ganz herzlichen Dank an alle