Renaming home folder
#1
After renaming the default user rock, I followed the instructions on the wiki to rename the home folder, using the following command in root terminal:


Code:
usermod -d /home/rock -m NewUser

I get the message returned:

Code:
usermod: no changes

How do I rename the default rock folder, so that my home folder name and user name match? I'm running the default Debian MATE OS.
#2
(01-14-2020, 05:19 PM)inkslinger Wrote: After renaming the default user rock, I followed the instructions on the wiki to rename the home folder, using the following command in root terminal:


Code:
usermod -d /home/rock -m NewUser

I get the message returned:

Code:
usermod: no changes

How do I rename the default rock folder, so that my home folder name and user name match? I'm running the default Debian MATE OS.


What happens if you log into a console as root and then mv /home/rock /home/NEWUSERNAME and then edit passwd with the new path for the user?
#3
(01-14-2020, 06:50 PM)evilbunny Wrote: What happens if you log into a console as root and then mv /home/rock /home/NEWUSERNAME and then edit passwd with the new path for the user?

After running that command, I got no messages (did it work? I don't know). Doing passwd NEWUSERNAME after that behaved as normal.

(01-14-2020, 08:17 PM)inkslinger Wrote:
(01-14-2020, 06:50 PM)evilbunny Wrote: What happens if you log into a console as root and then mv /home/rock /home/NEWUSERNAME and then edit passwd with the new path for the user?

After running that command, I got no messages (did it work? I don't know). Doing passwd NEWUSERNAME after that behaved as normal.

Actually, now I can't log in to NEWUSER from the main login screen after rebooting. It just keeps reloading the login screen. So, uh, I guess that broke something.

I can log in as NEWUSER in the terminal, but can't get into the account from the main login screen.
#4
@inkslinger, the Wiki instructions are these;
Code:
    Rename the rock user to your prefered username (replace myself with whatever you like):

# usermod -l myself -d /home/myself -m rock
However, with the state your account is in, those likely won't work any more.


It's fixable from the text console as user "root". But, we would need a bunch of information;
Code:
tail /etc/passwd /etc/shadow /etc/group
ls -la /home
ls -la /home/*
You can, if you like, blank out your user's encrypted password entry in "/etc/shadow". I'm just looking for the name to make sure it migrated to the new name.

With the above information we probably can help more. But then again, with the above information you will probably see what's wrong.
--
Arwen Evenstar
Princess of Rivendale
#5
(01-14-2020, 09:22 PM)Arwen Wrote: @inkslinger, the Wiki instructions are these;
Code:
    Rename the rock user to your prefered username (replace myself with whatever you like):

# usermod -l myself -d /home/myself -m rock
However, with the state your account is in, those likely won't work any more.
There is a different spot in the wiki where it breaks the command into two different commands, which is what I was following at first. That may have been the issue.


Code:
tail /etc/passwd /etc/shadow /etc/group
ls -la /home
ls -la /home/*

Here is the output. /etc/shadow was "access denied," so I don't know what's happening there. Hopefully, nothing I've pasted below is information I should have blanked out, since I mostly don't know what those outputs mean.


adam@Debian-Desktop:~$ tail /etc/passwd /etc/shadow /etc/group
==> /etc/passwd <==
systemd-resolve:x:102:104Confusedystemd Resolver,,,:/run/systemd/resolve:/bin/false
systemd-bus-proxy:x:103:105Confusedystemd Bus Proxy,,,:/run/systemd:/bin/false
_apt:x:104:65534::/nonexistent:/bin/false
ntp:x:105:109::/home/ntp:/bin/false
messagebus:x:106:110::/var/run/dbus:/bin/false
avahi:x:107:112:Avahi mDNS daemon,,,:/var/run/avahi-daemon:/bin/false
sshd:x:108:65534::/run/sshd:/usr/sbin/nologin
lightdm:x:109:113:Light Display Manager:/var/lib/lightdm:/bin/false
pulse:x:110:114TongueulseAudio daemon,,,:/var/run/pulse:/bin/false
adam:x:1000:1000:rock,,,,Adam Snider:/home/rock:/bin/bash
tail: cannot open '/etc/shadow' for reading: Permission denied

==> /etc/group <==
ntp:x:109:
messagebus:x:110:
ssh:x:111:adam
avahi:x:112:
rock:x:1000:
lightdm:x:113:
pulse:x:114:
pulse-access:x:115:
bluetooth:x:116:
sambashare:x:117:
adam@Debian-Desktop:~$ ls -la /home
total 16
drwxr-xr-x  4 root root 4096 Jan 15  2020 .
drwxr-xr-x 20 root root 4096 Jul 11  2019 ..
drwx------  4 root root 4096 Mar 12  2019 .Trash-0
drwxr-xr-x 25 adam rock 4096 Jan 15  2020 rock
adam@Debian-Desktop:~$ ls -la /home/
#6
Well, it looks like the rename of the group and home directory did not go through.

Using "root" from a text console, you can use this to try and fix it.
Code:
groupmod -n adam rock
tail /etc/group
ls -l /home

usermod -d adam -m adam
tail /etc/passwd
ls -la /home/adam
That should do it. I've included some verification steps to help.

But, I guarentee nothing :-).
--
Arwen Evenstar
Princess of Rivendale
#7
(01-14-2020, 09:37 PM)inkslinger Wrote: adam@Debian-Desktop:~$ tail /etc/passwd /etc/shadow /etc/group

Please not the $ sign
you are (mostly and not fouling yourself) a ordinary user here.

tail and other things with /etc/shadow will not work here.

Without looking in the wiki, I think sudo is missing here with the usermod command

If you messed up the thing and can't login via login greeter use the magic keys
CTRL-F1
and login as root or better as ordinary.
Note if your $home does not exist, you can't login, so you must use root
#8
(01-15-2020, 10:27 AM)ElektromAn Wrote:
(01-14-2020, 09:37 PM)inkslinger Wrote: adam@Debian-Desktop:~$ tail /etc/passwd /etc/shadow /etc/group

Please not the $ sign
you are (mostly and not fouling yourself) a ordinary user here.

tail and other things with /etc/shadow will not work here.

Without looking in the wiki, I think sudo is missing here with the usermod command

If you messed up the thing and can't login via login greeter use the magic keys
CTRL-F1
and login as root or better as ordinary.
Note if your $home does not exist, you can't login, so you must use root

I've replaced the $home, by reversing the instructions given by evilbunny near the start of the thread, so that's not a problem.

I was initially logged in as root when doing the usermod commands (the wiki doesn't mention sudo, but I think that's because it tells you to do it from a root terminal so sudo isn't needed). 

Anyway, I will go back in as root later today and try Arwen's suggestion. Hopefully, that will solve the issue.
#9
Yes if you are root sudo is not needed.
#10
(01-15-2020, 09:06 AM)Arwen Wrote: Well, it looks like the rename of the group and home directory did not go through.

Using "root" from a text console, you can use this to try and fix it.
Code:
groupmod -n adam rock
tail /etc/group
ls -l /home

usermod -d adam -m adam
tail /etc/passwd
ls -la /home/adam
That should do it. I've included some verification steps to help.

But, I guarentee nothing :-).

This seemed to partly work, but the final command gave me the message:

Code:
ls: cannot access '/home/adam': No such file or directory

And I'm now unable to login to user adam from the login screen. It just keeps taking me back to the login screen unless I log in as root.

Time to just create a new user?

OK, after doing:
Code:
-d /home/adam -m adam

I was able to once again login as adam from the GUI login screen.

Once in the account, a pop-up indicated:

Configured directory for incoming files does not exist.
Please make sure that directory "/home/rock" exists or configure it with blueman-services

I ran blueman-services to attempt to change the incoming folder, but clicking on the dropdown is unresponsive. Hovering the cursor over the drop down shows the message: "Applet's transfer service plugin is disabled".

Terminal gave the following readout:

Code:
adam@Debian-Desktop:~$ blueman-services
blueman-services version 2.0.4 starting
_________
load_plugins (/usr/bin/blueman-services:91)
['Network', 'Transfer']
_________
set_page (/usr/bin/blueman-services:138)
Set page Transfer
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.

(blueman-services:1259): Gtk-WARNING **: Failed to fetch network locations: Timeout was reached
Am I screwed? Should I create a new user and delete user adam? If so, uh, how do I do that?


Possibly Related Threads…
Thread Author Replies Views Last Post
  Network shared folder discovery (smb4k) solostian 10 10,399 12-06-2021, 07:27 AM
Last Post: solostian
  Cant boot into home-rolled Arch Linux image craftkiller 4 5,401 02-25-2020, 12:58 PM
Last Post: craftkiller

Forum Jump:


Users browsing this thread: 1 Guest(s)