I managed to change my userid and locked myself out - now what?

Status
Not open for further replies.

guermantes

Patron
Joined
Sep 27, 2017
Messages
213
Hi,
I managed to change the userID of my primary user 'peter' from 1002 to 1000 (I gleaned from another thread that this might be a bug and that it is supposed to be greyed out once the user is created, but it wasn't and I changed it) and since then 'peter' cannot mount my samba shares, nor can he log in (neither ssh, nor Windows explorer or Linux Mint equivalent). Other users can still log in and mount the shares.

I am hesitant to do anything more without guidance, so as not to worsen the situation.

What are my options? Simply use the buggy option again and change back to 1002? Reset some Freenas/Windows/Mint cache somewhere that is still holding on to 1002 in order to let 'peter' truly become 1000. Go perusing the samba configs? Something else?

(My preference would be a solution that lets 'peter' be 1000, because my Linux Mint primary user peter is 1000 and the userids apparently need to be the same in prder to mount writable NFS shares. That's how I got into this mess, I was trying to mount an NFS share and could only make it writeable by having the same userids locally and remotely.)
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
What are my options? Simply use the buggy option again and change back to 1002? Reset some Freenas/Windows/Mint cache somewhere that is still holding on to 1002 in order to let 'peter' truly become 1000. Go perusing the samba configs? Something else?
Pretty simple. The userID 1000 has no permissions. If you setup the user and assigned permissions when the userID was 1002, those permissions are attached to that number. Changing the number associated with the user 'peter' does not change the permissions associated with 1002 or create permissions associated with 1000. There is no hard binding between the user NAME and the user ID. If you change the number for peter back to 1002, it might all just start working again, if nothing got mixed up anywhere along the way. There are valid reasons for changing the number associated with a user name, but you would need to do that before you assign any permissions.
 

guermantes

Patron
Joined
Sep 27, 2017
Messages
213
@Chris Moore Thanks! I changed back to 1002 and all fell into place again.

Incidentally, when I changed back to 1002, the files in my NFS share became 'orphaned' and left with 1000 as owner because while 'peter' was 1000 I had done chown -R peter <those_files>. And lo and behold, after robooting and trying to access the NFS share I see that my local user 'peter' which is 1000 has write access to the orphaned files on the freenas that have lost their affiliation with 'peter' but are still 1000. What I take away from this (and problably should have realised long ago) is that in the Unix world, it is actually the User ID that matters rather than User NAME. The names just make it easier for us to handle the ids. (In theory I would think, then, and I will test this over X-mas if I get the time, local user 'molly'/1005 would have rw access to files owned by remote user 'andrew'/1005 on a freenas NFS share, as long molly is allowed to mount the share locally.)

Still, my local 'peter' has full rw-access to samba shares where peter/1002 owns the files. I havent' quite wrapped my head around Samba, but it seems Samba puts more emphasis on user names.
 

guermantes

Patron
Joined
Sep 27, 2017
Messages
213
For anyone at my skill level reading this thread, I just want to report back that everything did not fall into place, after all... I experienced write issues when creating new files and it just became a muddle that I could not resolve.
I am thinking about starting fresh with a new install of 11.2 rather than upgrading my 11.0 so that I can align the uid of peter with my local Mint from the start. Or perhaps removing my user peter from Freenas, upgrade, and then create the user again with proper 1000 uid. But I am not sure if that is a good strategy. Will take some thinking...
 
Status
Not open for further replies.
Top