You are not logged in.
Pages: 1
Dear all,
I am stuck in a problem and need your help.
***
Description: whenever I use 'sudo' in command, such as
- sudo pacman -Syu
- sudo xbacklight set
- sudo mount
etc.
it turns out this message: Segmentation fault
***
Not so bad, I still can use 'su' command to become a root and update my system totally.
Thank you for your help.
Last edited by hoalacanhdk (2020-07-12 10:11:06)
Offline
Could you show the content of /etc/sudoers file?
Offline
# strace sudo /bin/ls
# strace gdb --args /bin/ls
"#" because you must run those as root, for gdb usage see https://wiki.archlinux.org/index.php/De … _the_trace
Offline
Could you show the content of /etc/sudoers file?
Here it is.
---------------------------------------------------------------------------------------------------------------
root ALL=(ALL) ALL
## Uncomment to allow members of group wheel to execute any command
%wheel ALL=(ALL) ALL
## Same thing without a password
%wheel ALL=(ALL) NOPASSWD: /usr/bin/systemctl
gpasswd -a *** wheel
gpasswd -a *** adm
## Uncomment to allow members of group sudo to execute any command
# %sudo ALL=(ALL) ALL
## Uncomment to allow any user to run sudo if they know the password
## of the user they are running the command as (root by default).
# Defaults targetpw # Ask for the password of the target user
# ALL ALL=(ALL) ALL # WARNING: only use this together with 'Defaults targetpw'
## Read drop-in files from /etc/sudoers.d
## (the '#' here does not indicate a comment)
#includedir /etc/sudoers.d
-------------------------------------------------------------------------------------------------------------------------
where I have hidden the password.
Offline
# strace sudo /bin/ls # strace gdb --args /bin/ls
"#" because you must run those as root, for gdb usage see https://wiki.archlinux.org/index.php/De … _the_trace
Sorry, I don't get your point, can you explain more?
Offline
You shall run a debugger or stack tracer to see where sudo fails, however:
gpasswd -a *** wheel
gpasswd -a *** adm
If that's supposed to go for "wheel ALL=(ALL) NOPASSWD", you need to provide a comma separated lilst. No (unescaped) newlines.
Offline
Passwords should be stored in /etc/shadow. I suggest to remove that plain text bullshit from /etc/sudoers altogether. And make sure you properly edit /etc/sudoers with visudo command.
Also it might be useful to add
Defaults rootpw
at the end of the file.
Offline
Passwords should be stored in /etc/shadow.
How is this either relevant or even true?
Also it might be useful to add
Defaults rootpw
at the end of the file.
Why would that be useful? Don't recommend irrelevant settings simply because they are your preference for your machines.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
How is this either relevant or even true?
It's true but I agree it's not very relevant in this case, although it was enough to mess up sudoers file.
Why would that be useful?
Because it's more convenient to type root password instead of user password when you need root privilege.
Offline
Hashes should be stored in /etc/shadow, not passwords. But just the same, this has absolutely nothing to do with the current issues which seem to be just to having newlines instead of commas in a list.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
It's likely Trilby and Seth are way ahead of me here, but I don't understand at all what these statements are doing in sudoers, where (I think) the asterisk is meant to be an actual password that OP has blacked out for us, so therefore:
gpasswd -a [OP's root? password] wheel
gpasswd -a [OP's root? password] adm
Removing those two lines would probably fix the segmentation faults? And I would be surprised if visudo doesn't complain about them?
Offline
No, those asterisks are not blacked out passwords, they are the -a argument to gpasswd which takes a username not a password. I doubt they are blanked out, but are almost certainly meant as wildcards (why there are three I haven't a clue, one would suffice).
EDIT: Sorry, I missed the note that he "hid" the password - but just the same, a password makes absolutely no sense in the context of `gpasswd -a <password> wheel`, that's complete gibberish. It does make sense that those might be commands one would have a wildcard for the user for and entered as a Cmnd argument in sudoers.
Last edited by Trilby (2020-07-11 18:53:55)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
root ALL=(ALL) ALL
## Uncomment to allow members of group wheel to execute any command
%wheel ALL=(ALL) ALL
## Same thing without a password
%wheel ALL=(ALL) NOPASSWD: /usr/bin/systemctl
gpasswd -a *** wheel
gpasswd -a *** adm
## Uncomment to allow members of group sudo to execute any command
# %sudo ALL=(ALL) ALL
## Uncomment to allow any user to run sudo if they know the password
## of the user they are running the command as (root by default).
# Defaults targetpw # Ask for the password of the target user
# ALL ALL=(ALL) ALL # WARNING: only use this together with 'Defaults targetpw'
## Read drop-in files from /etc/sudoers.d
## (the '#' here does not indicate a comment)
#includedir /etc/sudoers.d
where I have hidden the password.
hoalacanhdk is *** indicating the password you have hidden?
Offline
root ALL=(ALL) ALL ## Uncomment to allow members of group wheel to execute any command %wheel ALL=(ALL) ALL ## Same thing without a password %wheel ALL=(ALL) NOPASSWD: /usr/bin/systemctl gpasswd -a *** wheel gpasswd -a *** adm ## Uncomment to allow members of group sudo to execute any command # %sudo ALL=(ALL) ALL ## Uncomment to allow any user to run sudo if they know the password ## of the user they are running the command as (root by default). # Defaults targetpw # Ask for the password of the target user # ALL ALL=(ALL) ALL # WARNING: only use this together with 'Defaults targetpw' ## Read drop-in files from /etc/sudoers.d ## (the '#' here does not indicate a comment) #includedir /etc/sudoers.d
hoalacanhdk wrote:where I have hidden the password.
hoalacanhdk is *** indicating the password you have hidden?
Yes, I explicitly mentioned that.
Offline
Ok, then: first sorry to everyone else for assuming there was some sense in that file. But hoalacanhdk, what on earth is that supposed to be? Why would you have gpasswd commands in there with passwords in place of user names? That'd be complete gibberish on a command line and makes less sense in a sudoers file.
I assume you've removed those lines by now - are the seg faults resolved?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Ok, then: first sorry to everyone else for assuming there was some sense in that file. But hoalacanhdk, what on earth is that supposed to be? Why would you have gpasswd commands in there with passwords in place of user names? That'd be complete gibberish on a command line and makes less sense in a sudoers file.
I assume you've removed those lines by now - are the seg faults resolved?
It works, thank you very much!
Offline
First mistake was made when this file was edited by something other than visudo. It would never allow such desecration to happen.
Last edited by finoderi (2020-07-12 05:17:39)
Offline
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Offline
Pages: 1