LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 07-13-2007, 04:15 PM   #1
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Rep: Reputation: 30
Files and owners


Hello there.

I just installed slack12. I just mounted a partition like this:
/dev/hda3 /home/ralvarez/hda3 reiserfs auto,user,exec,rw,sync 1 1

After doing this, i could see the files i used to have with the previous installation. The problem is that the user that owns the files is not my user, in this case, ralvarez. Of course, i can go directory after directory chown-ing the files so that i can use them and do whatever i want. There has to be an easier way to perform a conversion so that those files are normalized again adn belong to me, for instance.

How can i do this? I assume these steps involve chown or chmod but i can't find how to do it properly.

Thanks in advance for the help.
 
Old 07-13-2007, 04:53 PM   #2
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 65
I think that if you use chown with the "-R" flag would fix all the problems. The "-R" flag means that all files and subdirectories will be changed, not only one file or subdirectory. man chown
 
Old 07-13-2007, 05:00 PM   #3
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
It actually worked, thanks a lot man. Just one question. Is this like the way to do it or is there a more 'correct way' to take care of things like these?
 
Old 07-13-2007, 09:24 PM   #4
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by trebek
It actually worked, thanks a lot man. Just one question. Is this like the way to do it or is there a more 'correct way' to take care of things like these?
Using chown for this (as you did) is perfectly fine.
Code:
chown -vR trebek:users /home/ralvarez/hda3
It recursively changes the ownership of all files and subdirectories under the mount point.
 
Old 07-13-2007, 09:27 PM   #5
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 65
You are welcome mate .

There is not really right or wrong way to do that I think. As long as it works and it is protected enough . However, if those files need to be modified by another user (or several different users), you may want to give them a group-permission instead of user permission.

If you are interested to know how *nix permission works, I would recommend this thread:

http://www.linuxquestions.org/questi...81#post1878581

Regards!
 
Old 07-14-2007, 12:29 PM   #6
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
Will do, thanks!!!

LQ RULES!!!
 
  


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
slackware owners and groups BiThian Slackware 2 08-29-2006 12:34 PM
owners of files in tar TSloth Linux - General 2 05-22-2006 01:33 PM
Call for a Windows owners HOW-TO shilo Slackware 15 09-30-2004 05:46 PM
Playstation2 owners Fear58 General 6 06-13-2004 12:37 AM
numbers as file owners stabu Linux - General 3 04-27-2004 12:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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