Sudo login closes terminal

Hi Friends,

I need some help. This has gotta be something obvious I am missing. I am new to Arch/Manjaro but not to Linux or 'nix in general. [Queue up resume here, or … not.] Suffice to say I have a long history with the BSD world and a shorter one with Linux, but some mileage.

I have Manjaro Gnome installed in a VM that I am using to self-teach and also directly on an HP laptop I use for customer support. My daily driver [for now] is Mint/Cinammon but I am headed this way for a lot of reasons.

Weird problem. Here’s what I need: If I open a terminal and then >sudo login different_user Manjaro just closes the session, no excuses and no polite goodbye. :wink: But to be clear, I can sudo plenty of other stuff, indeed all of the regular functions as one would need. So sudo itself is not my problem.

I have been used to doing this for years in maintaining several servers and client workstations. Simply move from one user to another in this way without first logging out. But Manjaro is not letting me do that. Can someone explain why, or what I am missing?

Thanks in advance! [I did search for help on this. Didn’t find anything. But then, perhaps I just don’t do keywords right. ;)]

Hm …
I saw some odd sudo issues recently in relation to fingerprint readers … you dont use one or have something like that configured do you ?

( PS - here is one such quick link: [Unstable Update] 2020-12-02 - BREAKAGE EXPECTED - Python 3.9, Nvidia driver simplification, KDE-git )

Hi! Thanks for the reply. No, no fingerprint readers, no touchscreen. Just the normal laptop touchpad.

Does this happen when using qterminal?

And using a sub-shell? aka typing:

bash
sudo login [user]

Hi AltertoSalviaNovella,

Thank you very much for your help. Interesting suggestions, the learning continues.

First, Bash behaves the same way. I tried it just as you suggested, bash and then sudo login, same results. Then just for fun I tried >sudo bash first and then login other_user. Same behavior.

I then installed qterminal and exactly the same behavior, also doing it both ways.

Oh, by the way [didn’t mention this earlier] I have a third computer in the house set up as a media machine. Kodi, etc. It’s running Manjaro also. Never had an occasion to try a different user there, but just for fun I did. Same deal.

Looking forward to further suggestions. Much appreciated.

You could check which home dir and shell that user will employ with:

grep [USER] /etc/passwd

Then see if they are valid with:

file /home/[USER]
grep bash zsh fish /etc/shells

What is the intention here?

Hope it is not just switch user which is done with

su username

su stand for substitute user or switch user and not for superuser as some seem to think.

Also whit su it changes to the shell that is set for the user your switching to.

Kudos to SLaitEr and also AlbertoSalviaNovella. Problem solved!

Now, to be fair I did see in another thread the matter of using su … but I completely misunderstood what was going on there. I get it now. I think I was stumbling over something that went on in a former life under BSD where su was indeed the command to elevate oneself to root.

What I have done here is simply su -l different_user and there we go! Of course su also exists in the Debian/Mint world but I just never used it before because I was not required to do so. Honestly to me this seems better.

Thanks guys!

Gene

Glad to be able to help.

Remember that the su command works the same way in BSD and Linux.
So plain su will set root and su with a username behind it will switch to that user.

Info on su in freebsd

Guess you never used it that way before, which is understandable :slight_smile:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.