LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 05-07-2017, 04:10 PM   #1
mickeyboa
Senior Member
 
Registered: May 2004
Location: Indianapolis, Indiana
Distribution: FC-KDE, 32 and 64 bit
Posts: 1,720

Rep: Reputation: 68
Setting up new passwd for existing user


I upgraded from F21 to F25 ,in Installation I did not format the /home directory and left it intact, I set the passwd for one user during setup and install, but I did not set a passwd for a second user that was named "guest" and now that I'm in F25 , how do I assign a passwd for /home/guest ?

There is no settings in /etc/passwd for /home/guest.

I went into the Users Gui and tried to assign a passwd for guest but it won't let me do that unless I delete /home/guest and I don't want to do that, there is pictures in /home/guest
 
Old 05-07-2017, 04:29 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,346

Rep: Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552
Quote:
Originally Posted by mickeyboa View Post
I upgraded from F21 to F25 ,in Installation I did not format the /home directory and left it intact, I set the passwd for one user during setup and install, but I did not set a passwd for a second user that was named "guest" and now that I'm in F25 , how do I assign a passwd for /home/guest ?

There is no settings in /etc/passwd for /home/guest.

I went into the Users Gui and tried to assign a passwd for guest but it won't let me do that unless I delete /home/guest and I don't want to do that, there is pictures in /home/guest
I suggest that you rename /home/guest to /home/guest.old. Then go into the GUI and created user guest. Then copy whatever you need from /home/guest.old to /home/guest. If necessary then use the chown command to straighten out the ownership of files in /home/guest.

----------------------
Steve Stites
 
Old 05-07-2017, 04:40 PM   #3
mickeyboa
Senior Member
 
Registered: May 2004
Location: Indianapolis, Indiana
Distribution: FC-KDE, 32 and 64 bit
Posts: 1,720

Original Poster
Rep: Reputation: 68
Jailbait thank you, but surely there has to be a easier way to do it, on the command line.
 
Old 05-07-2017, 05:41 PM   #4
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
if a user /home/guest is already present. then just create a user name guest, you may get a message directory is all ready there, etc.. that is good.

then assign guest a password. the guest home directory is already there. the system will just use what is already there.

no need to make the guest dir an old dir and re create what is already there.
 
Old 05-07-2017, 06:55 PM   #5
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 382Reputation: 382Reputation: 382Reputation: 382
Not sure about the exact details of your "no user guest account created" situation, but
Did you try the # useradd -o switch? Unix works by uid/gid NUMBERS, irrespective of /etc/passwd "name mappings" (the kernel itself CAN function withOUT /etc/passwd!!!)
# cd /home; mv guest xxzxx; ls -l; df xxzxx; du -s xxzxx
(the df/du are just "sanity checks", to verify what's what)
Add guest user with *SAME* uid&gid numbers as xxzxx (in ls -l; also see ls -n switch)
Check (edit: vi -r ? vipw? naw: grep, more or less) /etc/{passwd,shadow,group}
Then, in /home, mv guest xxjunk; mv xxzxx guest; du -s guest
I -think- this will work, unless SELinux issues(?).

Last edited by !!!; 05-08-2017 at 02:22 AM.
 
Old 05-09-2017, 08:22 AM   #6
mickeyboa
Senior Member
 
Registered: May 2004
Location: Indianapolis, Indiana
Distribution: FC-KDE, 32 and 64 bit
Posts: 1,720

Original Poster
Rep: Reputation: 68
What is the commandline Command to change all files,folders to a user ?

chown -R *****
 
Old 05-09-2017, 10:41 AM   #7
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by mickeyboa View Post
What is the commandline Command to change all files,folders to a user ?

chown -R *****
you didn't do the
Code:
mv /home/user /home/user.old
cp -r /home/user.old/*  /home/user/
did you?
how you need to change everything to user:group /home/user -R ?

when you could have just kept it like it was and recreated the very same user name then given same said user name a password : done.

Last edited by BW-userx; 05-09-2017 at 10:43 AM.
 
Old 05-09-2017, 11:21 AM   #8
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,346

Rep: Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552
Quote:
Originally Posted by mickeyboa View Post
What is the commandline Command to change all files,folders to a user ?

chown -R *****
You also want to set the group name. Something like:

chown username:groupname /home/guest

chown -r username:groupname /home/guest/*


---------------------------
Steve Stites
 
  


Reply



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
Setting 'Password Inactive' field to 1 after setting maximum passwd age ? Grtyop Linux - Newbie 1 05-30-2013 07:49 PM
su: Authentication failure for root user even login wright user passwd jsaravana87 Linux - Server 1 02-09-2012 11:36 AM
[SOLVED] Add existing unix user to existing LDAP antoniemail Linux - Server 7 06-23-2010 12:54 PM
Setting Passwd of User from command line.... nirmit Linux - Newbie 4 11-25-2008 10:52 PM
add an existing user to an existing group? tramni1980 Slackware 5 05-08-2008 07:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 04:55 AM.

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