Password change
#1
the wiki page says the username change is "usermod -l NewUser -d /home/NewUser -m rock" but when I go into root I am unable to change anything I am getting "user rock is currently used by process 738 or invalid option -1     Undecided
#2
(01-21-2020, 09:35 PM)RedHaoredOmen Wrote: the wiki page says the username change is "usermod -l NewUser -d /home/NewUser -m rock" but when I go into root I am unable to change anything I am getting "user rock is currently used by process 738 or invalid option -1      Undecided

You probably either logged out and then back in as root or used sudo to get root. Those both leave processes owned by "rock" and the command fails. The way I got around the problem was to reboot and log in as root (default password is root unless you have clanged it) to make the changes. That way user "rock" will not have any processes. I made all the user changes and root password at that login. 

I also noticed a glitch when rebooting. The Login Screen still lists "rock" as the user not the new name. This problem shows up in other applications as well. It is due to to a formatting error (after the changes) in the /etc/passwd file that is likely caused by the chfn command. Each line of /etc/passwd should look like:

user_name:x:1000:1000:chfn_name,,,:/home/user_name:/bin/bash

but the newly changed entry will look like:

user_name:x:1000:1000:rock,,,chfn_name:/home/user_name:/bin/bash

note the difference in the chfn (5th) field.

You can edit the file with the command:

Code:
sudo nano /etc/passwd

but be careful to only correct the bad field in that one line. Make a backup first.
#3
(01-21-2020, 09:35 PM)RedHaoredOmen Wrote: the wiki page says the username change is "usermod -l NewUser -d /home/NewUser -m rock" but when I go into root I am unable to change anything I am getting "user rock is currently used by process 738 or invalid option -1      Undecided

I'm still new to this so forgive me if my help is not useful. When you went to change user name were you already logged into rock and then switched to root to do the change? If so try powering down and restart but this time log into root first then try to change. I wonder if that process was already running when you switched to root.

Edit:
Previous poster beat me on the reply and more well versed then mine. Go with that.
#4
(01-21-2020, 11:33 PM)mainer Wrote:
(01-21-2020, 09:35 PM)RedHaoredOmen Wrote: the wiki page says the username change is "usermod -l NewUser -d /home/NewUser -m rock" but when I go into root I am unable to change anything "user rock is currently used by process 738 or invalid option -1      Undecided

You probably either logged out and then back in as root or used sudo to get root. Those both leave processes owned by "rock" and the command fails. The way I got around the problem was to reboot and log in as root (default password is root unless you have clanged it) to make the changes. That way user "rock" will not have any processes. I made all the user changes and root password at that login. 

I also noticed a glitch when rebooting. The Login Screen still lists "rock" as the user not the new name. This problem shows up in other applications as well. It is due to to a formatting error (after the changes) in the /etc/passwd file that is likely caused by the chfn command. Each line of /etc/passwd should look like:

user_name:x:1000:1000:chfn_name,,,:/home/user_name:/bin/bash

but the newly changed entry will look like:

user_name:x:1000:1000:rock,,,chfn_name:/home/user_name:/bin/bash

note the difference in the chfn (5th) field.

You can edit the file with the command:

Code:
sudo nano /etc/passwd

but be careful to only correct the bad field in that one line. Make a backup first.

Thank you for your answer, more in depth than mine. Also I'm glad you mentioned the glitch with the rock name still showing up. I've been trying to figure out why that is. I'll change the passwd file like you mentioned. Is copying the original file first and renaming it something else a suitable back up? Sorry if that sounds dumb as I'm still learning. Other places I noticed rock showing up is when I go into settings, personalize, the GUI that pops up shows where you can change avatar and on this screen it still shows rock. Is this part of the glitch you think?
#5
(01-22-2020, 05:47 AM)FeMike Wrote: ...
I'll change the passwd file like you mentioned. Is copying the original file first and renaming it something else a suitable back up? Sorry if that sounds dumb as I'm still learning.
...
Yes, simply copying the file is a decent backup.
It's not dumb to ask for advice on something un-familiar.

For me, I like to use something like this, (adding hours & minutes if I need to have multiple backups in one day);
Code:
cp -p /etc/passwd /etc/passwd.`date +%Y%m%d`
chmod a-w /etc/passwd.`date +%Y%m%d`
This way, I preserve the last modification time of the file, (what you get when you use "ls -l /etc/passwd"). And you specify current date when you made the backup. Plus, if you try to write over the file, you should be prompted that the file is R/O. So harder to make a mistake. Last, I put the date numbers in most significant order to self-sort on a normal file listing.
--
Arwen Evenstar
Princess of Rivendale
#6
(01-22-2020, 07:14 AM)Arwen Wrote:
(01-22-2020, 05:47 AM)FeMike Wrote: ...
I'll change the passwd file like you mentioned. Is copying the original file first and renaming it something else a suitable back up? Sorry if that sounds dumb as I'm still learning.
...
Yes, simply copying the file is a decent backup.
It's not dumb to ask for advice on something un-familiar.

For me, I like to use something like this, (adding hours & minutes if I need to have multiple backups in one day);
Code:
cp -p /etc/passwd /etc/passwd.`date +%Y%m%d`
chmod a-w /etc/passwd.`date +%Y%m%d`
This way, I preserve the last modification time of the file, (what you when you use "ls -l /etc/passwd"). And you specify when you made the backup. Plus, if you try to write over the file, you should be prompted that the file is R/O. So harder to make a mistake. Last, I put the date numbers in most significant order to self-sort on a normal file listing.

Thank you. This forum seems more forgiving than over at XDA. Over there everyone has something critical to say for beginners.

Edit: I don't see a search feature to search through all the threads besides using ctrl f, but that only looks for keywords on the current page. Is there a way to search the entire forum instead of opening 20 pages and going through the list?
#7
Actually, the /etc/passwd backups are a bit useless since the real passwords are stored in /etc/shadow ...
#8
Just a quick follow up to add some information. As far as I can tell, the name fix is cosmetic and not necessary if you don't mind the references to "rock", and yes it seems to fix all of the "rock" references. I meant the backup of /etc/passwd just in case something went bad during the edit. You can get rid of it after everything is ok.

I made the change because I don't know what other problems might be caused by having a badly formatted passwd file.

Also, I have been playing with other distributions (on sd cards) and one of them (can't remember which) prevents logging in as root. For that distribution, the default  rock64 user has to use the control center to allow all (root) users to login and make the changes.
#9
(01-22-2020, 08:46 AM)martinayotte Wrote: Actually, the /etc/passwd backups are a bit useless since the real passwords are stored in /etc/shadow ...

So would you edit both files? I'm at work now so I can't see what the shadow file looks like to I get back to my pb64. Or is the shadow one encrypted and you can't modify it easily?
#10
(01-22-2020, 10:58 AM)FeMike Wrote:
(01-22-2020, 08:46 AM)martinayotte Wrote: Actually, the /etc/passwd backups are a bit useless since the real passwords are stored in /etc/shadow ...

So would you edit both files? I'm at work now so I can't see what the shadow file looks like to I get back to my pb64. Or is the shadow one encrypted and you can't modify it easily?

Both /etc/shadow and /etc/passwd are plain text, except that that /etc/passwd doesn't actually has any passwords in the file, while /etc/shadow has the encrypted passwd along with creation date, maximum age, warning expiratory period, etc.

For more details, simply do "man shadow" ...


Possibly Related Threads…
Thread Author Replies Views Last Post
  oem password iwm 8 3,626 02-19-2023, 07:35 PM
Last Post: iwm
  Graphical login hanging after password entry mhill8 2 3,842 03-29-2021, 08:32 AM
Last Post: jacksonliam341
  Forgot my Pinebook password. Booting from MIcroSD doesn't work. ksfoodforest 0 2,000 01-30-2021, 11:08 AM
Last Post: ksfoodforest
  MAC address change user0258 2 3,996 09-16-2020, 01:12 PM
Last Post: user0258
  [split] Change password from external media James Good 11 14,747 07-23-2020, 02:42 PM
Last Post: wdt
  Change Language xmark 1 3,518 06-08-2020, 12:56 PM
Last Post: tophneal
  PBP Complete Loss of Password Recognition jcj52436999 2 4,057 03-16-2020, 05:38 PM
Last Post: jcj52436999
  Default user name and password? CryptoRick 2 8,043 02-14-2020, 02:24 PM
Last Post: FeMike
  chromium keyring password change or remove Moon1 10 13,705 02-02-2020, 05:16 PM
Last Post: Moon1
  How to make Time change persistent FeMike 4 5,296 01-23-2020, 08:24 PM
Last Post: FeMike

Forum Jump:


Users browsing this thread: 2 Guest(s)