LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-26-2020, 09:02 AM   #1
kenmar
LQ Newbie
 
Registered: Jun 2020
Posts: 1

Rep: Reputation: Disabled
Change Debian username and password


I want to change my existing username and password for my existing files prior to creating a new user using existing name and password with a new set of files.
 
Old 06-26-2020, 11:11 AM   #2
GPGAgent
Senior Member
 
Registered: Oct 2018
Location: Surrey UK
Distribution: Mint 20 xfce 64bit
Posts: 1,026
Blog Entries: 3

Rep: Reputation: 133Reputation: 133
Quote:
Originally Posted by kenmar View Post
I want to change my existing username and password for my existing files prior to creating a new user using existing name and password with a new set of files.
man chown
 
Old 06-26-2020, 11:17 AM   #3
sevendogsbsd
Senior Member
 
Registered: Sep 2017
Distribution: FreeBSD
Posts: 2,252

Rep: Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011
Create a new user, use root to copy the files from the old user to the new one (/home), then chown the file ownership of the files in the new user's /home to that new user.
 
2 members found this post helpful.
Old 06-26-2020, 11:27 AM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Files' ownership is defined by the IDs of a user and a group. They don't contain user or group names, and they don't contain passwords.

It seems that you want to change the login name of an existing user. The command for that is usermod --login, but you must also rename the user's home directory. Furthermore, if the system is configured to create a primary group with the same name as the user, you have to rename that group, too. There may be files in the system that have the same name as the user, for example mailboxes or cron files, which have to be renamed. Not sure if this is all that's required. You must be superuser to perform these tasks.

To change the password, use the passwd command.
 
2 members found this post helpful.
Old 06-26-2020, 11:32 AM   #5
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
passwd
usermod
groupmod

A variety of ways. I did it when I initially got my pinebook. About the only time I've done something like this. Of course you could just create a new user and delete the old one. Backup your old data first since it might not go as expected if it's not something you're familiar with.

https://wiki.pine64.org/index.php/Pinebook_Pro

# passwd
# usermod -l newuser -d /home/newuser -m olduser
# groupmod -n newuser olduser

I think I had to manually $(mv) the olduser /home/ to the newuser. Otherwise it worked.
 
1 members found this post helpful.
Old 06-27-2020, 11:36 PM   #6
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US( + travel,) Earth&Mars (I wish,) END BORDER$!◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that work on freest-HW; has been KDE, CLI, Novena-SBC but open.. http://goo.gl/NqgqJx &c ;-)
Posts: 4,888
Blog Entries: 2

Rep: Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567
Google.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to username password and sort by weakest password rhbegin Programming 8 11-07-2012 08:39 AM
What is different between su <username>and su - <username> pinga123 Solaris / OpenSolaris 3 10-26-2009 04:26 AM
What is different between su <username>and su - <username> pinga123 Linux - Newbie 3 10-26-2009 12:35 AM
Differance between su <username> and su <username> - guguma Linux - General 3 08-19-2007 01:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration