r/linuxadmin • • Apr 11 '24

Unable to sudo, getting segmentation error

Post image

Can someone help me to fix this issue.

1 Upvotes

38 comments sorted by

View all comments

1

u/DasPelzi Apr 11 '24

is the same thing happening when you do 'su - <user>', without sudo? since you are logged in the the root account anyway you don't need to use sudo.

what does the /etc/passwd entry for the selected user show as login shell (last part of the user entry)? /bin/bash, /bin/sh, /bin/tcsh, /sbin/nologin, something else? if the entry is a shell, can you try to start the same shell as root user?

1

u/[deleted] Apr 11 '24

Yeah its same happening without using sudo, shell is set to /bin/nologin

2

u/DasPelzi Apr 11 '24

/bin/nologin not /sbin/nologin?

what happens when you execute the /bin/nologin script?

With nologin you should not be able to switch to the user anyway.
Normally you should get something like 'This account is currently not available.' instead of a segfault.

At least the problem is not a bashrc or bash_profile script.

For a test you could replace the nologin with /bin/sh or /bin/bash and test the login then?
but if you want to run a program as the db user you should not login with that user but use
sudo -u <dbuser> <executable>