Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Solved] Adding new user - switching users

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
User avatar
PsySc0rpi0n
Posts: 322
Joined: 2012-10-24 13:54
Location: Bitcoin World
Has thanked: 8 times
Been thanked: 1 time

[Solved] Adding new user - switching users

#1 Post by PsySc0rpi0n »

Hello.

I'm using Debian Buster with Plasma Desktop and sddm.
I'm trying to add a new user to my Debian Buster. This is to be an account to my daughter to start exploring and practicing to type with the laptop keyboard and start getting used with online searches, etc.

So I did the following command in terminal:

Code: Select all

sudo useradd -m -d /home/homefolder newuser
Then I switched to 'root' user and set a password to the newly created user using:

Code: Select all

passwd newuser
Then I went back to my normal user and tried to switch to the newly created user I used:

Code: Select all

su -s newuser
and enter my normal user password and I get the following error:

Code: Select all

su: failed to execute newuser: No such file or directory
and if I use the newuser password in the above command I get a different error:

Code: Select all

su: Authentication failure
If I issue:

Code: Select all

cat /etc/passwd
I get the following:

Code: Select all

newuser:x:1003:1004::/home/homefolder:/bin/sh
Why can't I switch to my daughter's newly created account?
Note: I already tried in a new terminal session. Also 'newuser' and 'homefolder' are just generic names I used. But I was consistent changing the names, so the generic names I used, are correctly replace in the correct places here in my post.
Last edited by PsySc0rpi0n on 2019-12-28 11:17, edited 1 time in total.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Adding new user - switching users

#2 Post by Head_on_a_Stick »

Run adduser(8) instead, this isn't Arch.

You will have to delete that abortive initial attempt first though:

Code: Select all

# deluser
deadbang

User avatar
PsySc0rpi0n
Posts: 322
Joined: 2012-10-24 13:54
Location: Bitcoin World
Has thanked: 8 times
Been thanked: 1 time

Re: Adding new user - switching users

#3 Post by PsySc0rpi0n »

I'm trying to use:

Code: Select all

sudo adduser --home /home/homefolder --shell bash newuser
and I get the following error:

Code: Select all

adduser: Please enter a username matching the regular expression configured
via the NAME_REGEX configuration variable.  Use the `--force-badname'
option to relax this check or reconfigure NAME_REGEX.
What am I missing now?

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Adding new user - switching users

#4 Post by Head_on_a_Stick »

Just run

Code: Select all

# adduser newuser
Nothing else.
deadbang

User avatar
PsySc0rpi0n
Posts: 322
Joined: 2012-10-24 13:54
Location: Bitcoin World
Has thanked: 8 times
Been thanked: 1 time

Adding new user - switching users

#5 Post by PsySc0rpi0n »

Head_on_a_Stick wrote:Just run

Code: Select all

# adduser newuser
Nothing else.
But I don't want the home dir the same as the user name and the default terminal application I want it to be bash. What is wrong with the command?

Sent from my SM-G935F using Tapatalk

arzgi
Posts: 1194
Joined: 2008-02-21 17:03
Location: Finland
Been thanked: 31 times

Re: Adding new user - switching users

#6 Post by arzgi »

Code: Select all

ADDUSER(8)                  System Manager's Manual                 ADDUSER(8)

NAME
       adduser, addgroup - add a user or group to the system

SYNOPSIS
       adduser  [options]  [--home  DIR]  [--shell  SHELL]  [--no-create-home]
       [--uid ID] [--firstuid ID] [--lastuid ID] [--ingroup GROUP | --gid  ID]
       [--disabled-password]  [--disabled-login]  [--gecos  GECOS]  [--add_ex‐
       tra_groups] user

User avatar
PsySc0rpi0n
Posts: 322
Joined: 2012-10-24 13:54
Location: Bitcoin World
Has thanked: 8 times
Been thanked: 1 time

Adding new user - switching users

#7 Post by PsySc0rpi0n »

arzgi wrote:

Code: Select all

ADDUSER(8)                  System Manager's Manual                 ADDUSER(8)

NAME
       adduser, addgroup - add a user or group to the system

SYNOPSIS
       adduser  [options]  [--home  DIR]  [--shell  SHELL]  [--no-create-home]
       [--uid ID] [--firstuid ID] [--lastuid ID] [--ingroup GROUP | --gid  ID]
       [--disabled-password]  [--disabled-login]  [--gecos  GECOS]  [--add_ex‐
       tra_groups] user
Yes, I know. I read it before coming here.
So, what is wrong with the command?

I give it no options, give 2 arguments in the correct sequence, I guess, which are --home and --shell, then I give the user name. What is wrong here?

Sent from my SM-G935F using Tapatalk

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Adding new user - switching users

#8 Post by Head_on_a_Stick »

This works for me:

Code: Select all

# adduser --home /home/homefolder --shell /bin/bash newuser
No idea why you're having problems.
deadbang

User avatar
PsySc0rpi0n
Posts: 322
Joined: 2012-10-24 13:54
Location: Bitcoin World
Has thanked: 8 times
Been thanked: 1 time

Re: Adding new user - switching users

#9 Post by PsySc0rpi0n »

Head_on_a_Stick wrote:This works for me:

Code: Select all

# adduser --home /home/homefolder --shell /bin/bash newuser
No idea why you're having problems.
Ok, I got it.
I didn't used real names here but the problem was that I was using lower and capital letters in username which I can't according to the default set in NAME_REGEX.

Solved.
Thanks

Post Reply