LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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-24-2011, 11:30 AM   #1
theif519
Member
 
Registered: Mar 2011
Location: Rochester, NY
Distribution: N/A
Posts: 255

Rep: Reputation: 4
How do I change change the home directory to be owned by me and not root? Slackware


I've already done the following commands

Code:
su
chown theif519 /home/theif519
chmod 775 /home/theif519
exit
#usermod -d /home/theif519 login *I would also like for someone to explain how this command works, if you'd be so kind*
I've logged out and logged back in, and I was successful in making it the default directory it logs in to. Still, afterwards I noticed that that when I use the list all commands "ls -l" it shows that root owns it and it also shows that I do not, by default, have read write execute over it, only read execute. Sorry if I'm not making any sense. *I'm using Slackware 13.37* in a Virtual Machine*

Another thing, I don't think I added any rights to my user, how do I give it more rights as well? Like, wheel and sudo and all of that stuff.

Also, this was the website I was using *Although it didn't help much, the comments sure did*

http://nixtechnica.blogspot.com/2007...ectory-in.html

Last edited by theif519; 06-24-2011 at 11:32 AM.
 
Old 06-24-2011, 12:00 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Hi there,

The command you mentioned should work. Not sure why it is showing root as owner in ls -l. I would suggest you to try the following thing:

1. su - root
2. chown theif519.theif519 /home/theif519 /* You are making theif519 user private group and the user itself to be the owner:group of that particular home directory

3. chmod 775 /home/theif519 /* I would suggest you should use chmod 644 /home/theif519 instead */

4. Do ls -l /home

5. Exit

6. Login as the user and see if you have got the required rights. Perform ls -l using your user account in /home. ls -l /home

Let us know if it works.
 
Old 06-24-2011, 12:07 PM   #3
diamondsandrain
Member
 
Registered: Oct 2009
Location: Canada
Distribution: Gentoo, Slackware, Arch
Posts: 97

Rep: Reputation: 21
Is it possible that the root ownership showing is actually the root ownership of ".." in the directory listing of ls -al, the actual /home directory, which should be owned by root.
 
Old 06-24-2011, 12:13 PM   #4
theif519
Member
 
Registered: Mar 2011
Location: Rochester, NY
Distribution: N/A
Posts: 255

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by T3RM1NVT0R View Post
Hi there,

The command you mentioned should work. Not sure why it is showing root as owner in ls -l. I would suggest you to try the following thing:

1. su - root
2. chown theif519.theif519 /home/theif519 /* You are making theif519 user private group and the user itself to be the owner:group of that particular home directory

3. chmod 775 /home/theif519 /* I would suggest you should use chmod 644 /home/theif519 instead */

4. Do ls -l /home

5. Exit

6. Login as the user and see if you have got the required rights. Perform ls -l using your user account in /home. ls -l /home

Let us know if it works.
Thank you, by using part of what you suggested

Code:
 chown theif519.theif519 /home/theif519
It now shows it owned by me. I hope that this means that from now on, whatever I add, it's contents will belong to me instead of root. Now another thing, is this enough, or do I need to add my account to more groups like wheel and sudo?
 
Old 06-24-2011, 12:21 PM   #5
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Yes, it will belong to the user account from now onwards. One more thing you could do to modify the existing ownership under your home directory is the following command:

chown -R theif519.theif519 /home/theif519

The above command will recursively change the ownership of the file underneath the user's home directory. Beaware, never run this command on / as it might lead to non-recoverable situation as it changes the ownership recursively.

Sorry in the first post I forgot to explain this:

#usermod -d /home/theif519 login *I would also like for someone to explain how this command works, if you'd be so kind*

The above command instruct the system that modify the user's home directory to be the one that followed by -d and --login or -l will be the login name of the user.

This command is usually used when either user's home directory or user account has been renamed.

I hope this helps.
 
1 members found this post helpful.
  


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
[SOLVED] How can i change my HOME (/home/user) directory location to something else? QueenZ Linux - Newbie 6 08-05-2010 06:26 AM
User Home Directory now owned bt Root AndeAnderson Linux - Newbie 4 10-09-2009 03:52 PM
All files/Directories owned by root (unable to change with "chown") KinnowGrower Linux - Desktop 8 10-22-2008 10:18 AM
Change HOME directory? bhuwan Linux - Newbie 7 01-30-2006 09:19 AM
how to change a user's Home directory n1wil Linux - General 8 08-24-2002 03:22 PM

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

All times are GMT -5. The time now is 11:01 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