You are not logged in.

#1 2019-05-30 05:15:31

CoreFour1996
Member
Registered: 2019-05-29
Posts: 21

[SOLVED] I am unable to log in as my user.

I created a new user using

useradd -g users -G wheel,storage,power -m corefour1996

and I added

corefour1996 ALL=(ALL) ALL

to visudo, but when I try to log in using this user, I am told that the login was unsuccessful. However, if I change the username to root when logging in and use the same password, it works just fine. However, because of this I am unable to install yay or any AUR packages.


Am I missing something? What am I doing wrong?

Last edited by CoreFour1996 (2019-05-30 22:16:21)

Offline

#2 2019-05-30 05:34:41

ivanmlerner
Member
From: São Paulo
Registered: 2016-03-30
Posts: 37

Re: [SOLVED] I am unable to log in as my user.

Read the manual for the useradd command, and also read the wiki on users and groups. Keep a habit of reading those when you encounter problems.

The -g option is not necessary here, and it is used incorrectly. Also, you don't need to have your user in the power group, as it is not used as stated, again, in the wiki.

Offline

#3 2019-05-30 07:21:30

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,500

Re: [SOLVED] I am unable to log in as my user.

Nothing of that will break the user creation.

cat /etc/passwd

(This is safe, there're no passwords in this file)

if I change the username to root when logging in and use the same password, it works

Suggests you changed the root password instead of setting it/one for the user. (Though iirc nullok should be the default, you're probably passing the wrong instead of no password at the login)

Offline

#4 2019-05-30 12:27:57

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,530
Website

Re: [SOLVED] I am unable to log in as my user.

Not that visudo has nothing to do with logging in, but - as noted above - you didn't mention anything about setting/creating a password for this new user.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2019-05-30 16:34:10

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [SOLVED] I am unable to log in as my user.

Nor anything about creating the user's home dir.

Edit: missed it, it's there. Sorry.

Last edited by Scimmia (2019-05-30 16:35:56)

Offline

#6 2019-05-30 16:37:17

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,500

Re: [SOLVED] I am unable to log in as my user.

?
useradd … -m …

Edit: too late ;-)

Last edited by seth (2019-05-30 16:38:05)

Offline

#7 2019-05-30 21:59:44

CoreFour1996
Member
Registered: 2019-05-29
Posts: 21

Re: [SOLVED] I am unable to log in as my user.

ivanmlerner wrote:

The -g option is not necessary here, and it is used incorrectly. Also, you don't need to have your user in the power group, as it is not used as stated, again, in the wiki.

I was trying to use the -g option to give myself permission to access my other hard-drives and external media. It seemed more convenient than using chown. I'll look through the useradd wiki like you mentioned and see how it should be used.

Offline

#8 2019-05-30 22:05:01

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,530
Website

Re: [SOLVED] I am unable to log in as my user.

CoreFour1996 wrote:

I was trying to use the -g option to give myself permission to access my other hard-drives and external media. It seemed more convenient than using chown.

This sounds like an XY problem.  Chowning things is not the proper alternative.  But this is off the topic of this thread.

CoreFour1996 wrote:

I'll look through the useradd wiki like you mentioned and see how it should be used.

This is all a bit backwards.  You tried something first, asked on the forums when it failed second, and will read the wiki on how it should be done third.  For future endeavors, reverse the order of these.

Anyhow - did you even set a password for your user?

Last edited by Trilby (2019-05-30 22:05:41)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#9 2019-05-30 22:06:23

CoreFour1996
Member
Registered: 2019-05-29
Posts: 21

Re: [SOLVED] I am unable to log in as my user.

Suggests you changed the root password instead of setting it/one for the user. (Though iirc nullok should be the default, you're probably passing the wrong instead of no password at the login)

Yes, that was exactly the issue. I just tried passwd [username] and was able to set the password properly. I apologize for my stupidity.

Offline

#10 2019-05-30 22:08:16

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,530
Website

Re: [SOLVED] I am unable to log in as my user.

What documentation have you been following to install this system?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#11 2019-05-30 22:10:41

CoreFour1996
Member
Registered: 2019-05-29
Posts: 21

Re: [SOLVED] I am unable to log in as my user.

Trilby wrote:

This is all a bit backwards.  You tried something first, asked on the forums when it failed second, and will read the wiki on how it should be done third.  For future endeavors, reverse the order of these.

To clarify, I did read skim through the wiki initially. But I was told what I did was wrong so I will now read it again properly to see what I should have done instead.

Anyhow - did you even set a password for your user?

Yes, I just did that.

I guess I should read the wiki more carefully and post as a last resort.

Offline

#12 2019-05-30 22:12:35

CoreFour1996
Member
Registered: 2019-05-29
Posts: 21

Re: [SOLVED] I am unable to log in as my user.

Trilby wrote:

What documentation have you been following to install this system?

I followed the Arch Wiki installation guide. It mentioned using passwd to set a root password, but it didn't mention needing one for any users you add. I figured the root password would be the same as the user password by default.

Offline

#13 2019-05-30 22:18:29

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,530
Website

Re: [SOLVED] I am unable to log in as my user.

CoreFour1996 wrote:

I guess I should read the wiki more carefully and post as a last resort.

No.  Feel free to post if you are unsure about anything.  But please do read the wiki more carefully.  From your threads so far, I was suspecting you might be following some other unsupported and broken documentation.

Note that the installation guide only links out to General Recommendations for creating a non-root user.  That in turn leads you here which notes the need to set a password for the user.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB