Linux Mint, use the session of a second user
SolvedHello everyone
I'm using Linux Mint. I just created a new user with standard rights. I assigned a password to them, but in graphical mode, I can't do anything else.
In a terminal, I tried a command I found on a Linux forum "
sudo passwd -S username
But it gives me a command not found error, am I missing a package, what should I do?
Thanks in advance
11 réponses
Hello,
One possible explanation is that one of the commands involved is not installed. Your shell should indicate which command is not found, but since you didn't report the error message, I assume it is sudo. Indeed, the passwd command is installed with the base system, so I doubt it is the one missing. The sudo command is not installed by default on some distributions, including Debian. What surprises me is that sudo is installed by default on Ubuntu, from which Mint is derived.
Another possible explanation is that you made a typo. Try typing your command again (in particular, it can happen that invisible characters are inadvertently typed). This can occur if you accidentally pressed the alt or alt gr key, typically when trying to make a space. In this case, just retype the command (or recall it by pressing the up arrow key and then removing the spaces and the neighboring characters around the spaces).
Below are some clarifications assuming we are in the first case.
Running administrator commands through sudo
To install sudo, switch to root and install it via apt:
su - apt update # Retrieve the list of the latest package versions apt upgrade # If you want to update installed packages apt install sudo
Then you need to add the user(s) allowed to use sudo to the sudo group. For example, to add toto to the sudo group:
usermod -a -G sudo toto
If you switch to toto, you can check that toto indeed belongs to the sudo group:
su - toto groups
From there, you can start using the sudo command with toto.
Finding the package that provides a command using apt-file
In the following, I assume the user who runs commands is a member of the sudo group and can therefore use sudo, but you can also run the relevant commands without sudo as root.
First, let's install apt-file:
sudo apt install apt-file
Do not confuse apt search and apt-file search. The former searches in the description and name of packages, while the latter searches their content. This nuance is indirectly perceived on package search engines like https://packages.ubuntu.com/.
Once apt-file is installed, we build its search database.
sudo apt-file update
This is something you will need to do from time to time, especially when you are searching for a file that you cannot find with apt-file:
Finally, we search for the file we want. Here we are looking for an executable. According to the FHS, a command installed by the package manager is deployed in /bin, /sbin, /usr/bin or /usr/sbin. For example, the command foo could correspond to either /usr/bin/foo, /bin/foo, /usr/sbin/foo or /sbin/foo. Thus, even if we do not know which of these folders the executable will be deployed in, we know that its absolute path ends (which is written with $ in the language of regular expressions) with bin/foo. So, if we want to find out which package provides the passwd command, we execute:
apt-file search bin/passwd | grep bin/passwd
Example: the command passwd is provided by the package of the same name.
(mando@silk) (~) $ apt-file search bin/passwd | grep bin/passwd$ passwd: /usr/bin/passwd Good luck
When I type the name of the second user, it asks me for their password, so this account exists.
Now, chatGPT is asking me to install and verify LightDM.
But I'm suspicious.
Did you create your user with the adduser command?
sudo deluser florence sudo adduser florence
Did you try retyping your command?
sudo passwd -S florence
Example:
(mando@silk) (~) $ sudo adduser florence Adding user `florence' ... Adding new group `florence' (1001) ... Adding new user `florence' (1001) with group `florence' (1001) ... Creating home directory `/home/florence'... Copying files from `/etc/skel'... New password: Retype new password: passwd: password updated successfully Modify the information associated with a user for florence Enter new value, or press ENTER for the default value NAME []: Room Number []: Work Phone []: Home Phone []: Other []: Is this information correct? [Y/n]Y Adding new user `florence' to supplemental / extra groups `users' ... Adding user `florence' to group `users'... (mando@silk) (~) $ sudo passwd -S florence florence P 2023-02-27 0 99999 7 -1 Good luck
thank you for your response, no I created the user "florence" in graphical mode
when I type sudo passwd -S florence
, it always responds
florence P 02/22/2023 0 99999 7 -1
the simplest thing would be to delete the second user and recreate it in a terminal?
Hello,
it always responds to me florence P 02/22/2023 0 99999 7 -1
As shown in my message #5, I have the same behavior with sudo adduser. So there's no need to recreate your user. However, what I don't understand is what behavior you're expecting.
Good evening
The behavior I expect: that when the computer starts, I have the choice between my profile or the second profile
Hello,
If your two users have been created and your display manager (likely lightdm or sddm) does not enable automatic login, you should have to enter your login and password before starting your graphical session. Is that the case?
Good luck
Hello
That's not the case, I have configured the system so that my main session does not require a password
Hello
That's not the case, I've configured the system so that my main session does not require a password.
Okay, so that's what we call automatic login, and in my opinion, it has nothing to do with how you create your new user Florence.
Since you've enabled automatic login, upon startup, when your login manager (lightdm or sddm) starts, it automatically launches a graphical session with your main user.
To switch users, there are several ways to proceed:
- Either you disable automatic login, and at startup your login manager will give you the choice to log in with your main user or Florence.
- Or you log out of the main session, but instead of shutting down or restarting your computer, you choose to log out, which will display your login manager and give you the option to log in as Florence.
Good luck
Hello
Thank you for your response. The automatic login didn't mean much to me.
So I dug into the system, and I saw the login window. It clicked for me, and then I saw a "user" tab and my username at the bottom. I highlighted it, and whoosh, deleted it (not really sure about it).
I restarted the PC, and now I have a choice.
PS 1, I don't have a "disconnect" option.
PS 2: can you mark this message as resolved, because, for some mysterious reason, we can no longer do it ourselves.
