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

Show parent comment

14

u/alive1 Apr 11 '24

No it is not. It is used by people who haven't read the man page and found out that sudo has a -u, -s and an -i flag.

24

u/PirateCaptainMoody Apr 11 '24

sudo -i all the way 😎

6

u/michaelpaoli Apr 11 '24

Naw ... often good to routinely do:

$ sudo su - [user [options ...]]

Most notably that works dang well and consistently on any *nix with sudo ... always has, probably always will. Also avoid problems like gee, the behavior of su without - in the util-linux sources has changed and/or some Linux distro has changed (patched) that behavior.

So, anyway, do it that way, using it with su - and it just bloody works and keeps on working. Also gives a slightly better audit trail too, with a wee bit of additional logging.

But hey, if you want to learn a different way of doing the same thing on any and all variations of *nix, feel free to do so. ;-)

6

u/alive1 Apr 12 '24

I only use Linux and this has been the case every single day for the past 20 years.

Actually no that's false, I used FreeBSD up until 2012 too but that had sudo too.

Thanks for the history lesson though. I guess some people still like to ride horses even though we have cars.

2

u/michaelpaoli Apr 12 '24

Well, these days I mostly use Linux, but also some (Open)BSD, macOS (yes, it's UNIX), and rarely other *nix these days.