You are not logged in.

#1 2020-10-19 06:16:06

sumcaracalla
Member
Registered: 2019-01-26
Posts: 8

Newly-created user not having access to any command wit old directory

Greetings

Here's some background information as I believe it might help give some clues.

Today, I had to clean my entire root and boot partitions and re-installed arch linux completely clean. However, I kept my home drive(and home directory) exactly the same as it was before the clean install on the boot and root partitions.

It might be of importance to note that the boot and root are both partitioned in an nvme ssd while the home drive is in a different hard drive.

Now, the problem is that after everything is all set up and fine. Once I create a new username with the same name I had prior and log in, almost all the commands don't work for my user.

When using useradd -m mark while logged in as root, I get this:

useradd : warning: the home directory home/mark already exists.
useradd: Not copying any file from skel directory into it.

Now, after I log in with the newly-created username. All commands besides logout don't seem to work. They all say command not found.
I tried making other users to test and all the commands work fine.

I do not want to delete my original home directory as I have a lot of important files in it. Is there any way in which I can keep the same username and have it be linked with my 'old' home directory under the same name?

I am not sure if I skipped over some step on the installation guide but everything works fine on root and on any other user I create.

Thanks for taking the time to read.

Offline

#2 2020-10-19 06:51:06

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,761

Re: Newly-created user not having access to any command wit old directory

It's likely that the numerical UID/GID of the new user doesn't match the old one. You can either create the user with the same UID or chown your old home directory to the new user with e.g.

sudo chown -R mark:users  /home/mark

Maybe for better diagnosis post, as root and in [ code ] [ /code ] tags without spaces

stat /home/mark
id mark

Offline

#3 2020-10-19 18:52:09

sumcaracalla
Member
Registered: 2019-01-26
Posts: 8

Re: Newly-created user not having access to any command wit old directory

Thanks for the reply.

Using chown takes a long amount of time, my home drive has a lot of information so I assume that's why.  Should I still let it run?

Output for stat /home/mark

root@Luchesi )# stat /home/mark
File: /home/mark
Size: 4096
Blocks: 8
IO Block: 4096 Directory
Device: 813h/2067d
Inode: 2883585 Links: 88
Access: (6788/drws--S---) Uid: ( 1000/
mark) Gid: ( 998/ Wheel)
Access: 2020-10-19 13:18:58.636208586 +0000
Modify: 2020-10-19 00:17:30.834553741 +0000
Change: 2020-10-19 00:17:30.834553741 +0000
Birth: 2018-08-01 14:00:59.966805138 +0000

Output for Id mark

root@Luchesi )# id mark
uid=1000 (mark)
gid=998 (wheel)
groups=998 (wheel)

I should say that I tried to change the UID/GID for the user but either I did it wrong(followed this, under example adding system user)or it didn't do anything.

What I did was delete the user mark with userdel. Then created a new one with:

useradd -u 1000 -g 998 mark

Last edited by sumcaracalla (2020-10-19 18:58:28)

Offline

#4 2020-10-19 18:56:37

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,761

Re: Newly-created user not having access to any command wit old directory

Not sure how I feel about wheel here, that's a sysadmin group for sysadmin tasks.

If these are after shooting off the chown the results are somewhat expected sorry I see that I've worded this confusingly, it would've been useful to have these before attempting a chown. But now that you've done it you should let it run yes.

What is definitely still weird here are the access permissions, afaik they should normally be 0700.

Last edited by V1del (2020-10-19 19:00:30)

Offline

#5 2020-10-19 19:02:36

sumcaracalla
Member
Registered: 2019-01-26
Posts: 8

Re: Newly-created user not having access to any command wit old directory

I see, I am running the chown command you listed, I will report back whenever it is finished.

As far as permissions go, I have not done anything in particular for /home/mark

Last edited by sumcaracalla (2020-10-19 19:02:54)

Offline

#6 2020-10-19 19:08:02

sumcaracalla
Member
Registered: 2019-01-26
Posts: 8

Re: Newly-created user not having access to any command wit old directory

Alright.... So running

sudo chown -R mark:users /home/mark

No longer takes a long time and doesn't seem to be doing anything...

Same as before, none of the commands are found. I thought it had to do with bash or some sort of permission the user mark isn't allowed to access because of /home/mark directory already existing.

Offline

Board footer

Powered by FluxBB