LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-22-2009, 10:14 PM   #1
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,375

Rep: Reputation: Disabled
can I chown to anyone on the system?


I just had to chown my backup hard drive to my account. No problem with that, but I just wondered something. This is academic, because I'm the only user; but if there were others or if I had more than one account (notwithstanding that I have no idea why I would), could I chown to "anyone," whatever the syntax might be?

Last edited by newbiesforever; 01-22-2009 at 10:30 PM.
 
Old 01-22-2009, 10:34 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
If you have admin (root) privileges, you can change anything and everything.
 
Old 01-22-2009, 10:43 PM   #3
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,375

Original Poster
Rep: Reputation: Disabled
Good. Then what's the syntax for "anyone" when chowning?
 
Old 01-22-2009, 11:44 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
man chown & man sudo.

If you want to allow everyone to have access, then use chmod to enable "o" (others) access. If all users are a member of a group such as "users", then you could change the group ownership of the file.
 
Old 01-23-2009, 09:13 AM   #5
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
Quote:
Originally Posted by newbiesforever View Post
I just had to chown my backup hard drive to my account. No problem with that, but I just wondered something. This is academic, because I'm the only user; but if there were others or if I had more than one account (notwithstanding that I have no idea why I would), could I chown to "anyone," whatever the syntax might be?
There are two programs, chown and chmod.

chown changes ownership.
chmod changes permissions (for owner, group, and "anyone").

Let me give you an example:

Code:
school:~# ls -l
drwxr-x--x 2 root    staff 4096 2009-01-23 07:40 dir1
-rw----r-- 1 student staff    0 2009-01-23 07:40 file1
Lets break this down a bit for dir1 we have...
Code:
d   <- bit telling us this is a directory
rwx <- Owner rights
r-x <- Group rights
--x <- Everyone elses rights
For directories (r) means list the contents of the directory
For directories (w) means modify contents of the directory or create new
For directories (x) means make the directory your working directory

For file1 we have...
Code:
-   <- nothing special
rw- <- Owner rights
--- <- Group rights
r-- <- Everyone elses rights
For files (r) means you can read the contents of the file
For files (w) means you can change the file or delete it
For files (x) means you can tell the system to execute the file

If I was root and wanted to create those files like that here is what I would do:

Code:
mkdir dir1
touch file1
chmod 0751 dir1
chmod 0604 file1
chown root:staff dir1
chown student:staff file1
I've always found numeric permissions easier to grasp and understand because they're simple addition: r=4, w=2, x=1. Add them up for each section... rwx=4+2+1=7 rx=4+1=5 x=1, rw=4+2=6 none=0 r=4. I think learning them this way in the long run makes it easier when you find a need to understand umask also. There are some special bits you can add too, like setuid, setgid, sticky bit (that's what the first 0 represents), but if you understand the basics its all much easier.

Any who I'll shut up now

If you need better examples or want to look at the alternate syntax using the non-numerical method, you can look at the wikipedia article for the two programs which explain them quite well in my opinion and even offer good examples.

chmod - chown

Last edited by rweaver; 01-23-2009 at 09:14 AM.
 
Old 01-24-2009, 09:14 AM   #6
renjithrajasekaran
Member
 
Registered: Jan 2009
Posts: 29

Rep: Reputation: 15
So - You're telling me that an admin can simply chown any of the "restricted" files on my home folder and view them?

Seriously ???

Linux Archive

Last edited by renjithrajasekaran; 01-25-2009 at 03:07 AM.
 
Old 01-24-2009, 11:31 AM   #7
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
Quote:
Originally Posted by renjithrajasekaran View Post
So - You're telling me that an admin can simply chown any of the "restricted" files on my home folder and view them?

Seriously ???
Yup.

-C
 
Old 01-24-2009, 12:46 PM   #8
Lordandmaker
Member
 
Registered: Sep 2005
Location: London, UK
Distribution: Debian
Posts: 258

Rep: Reputation: 39
Quote:
Originally Posted by renjithrajasekaran View Post
So - You're telling me that an admin can simply chown any of the "restricted" files on my home folder and view them?
He wouldn't need to chown them.
 
Old 01-24-2009, 02:33 PM   #9
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Quote:
Originally Posted by renjithrajasekaran View Post
So - You're telling me that an admin can simply chown any of the "restricted" files on my home folder and view them?

Seriously ???
It sounds like it's not your system, so you need to get into the mindset of using other people's property. The admin is god. He can view your files, delete them, copy them, and suspend or remove your access to the machine. Normally none of these things are done, as the admins have more important things to do than to peruse their users' files. But, it's important to keep this in mind when deciding whether to put personal files on your company's/school's computers.
 
Old 01-24-2009, 11:00 PM   #10
maginotjr
Member
 
Registered: Aug 2004
Location: BR - Floripa
Distribution: Ubuntu 9.10 - 2.6.x.x
Posts: 661

Rep: Reputation: 35
root is the God on your system but you always can try to hide something from him, like using some tool like EncFS that Encryptate any folder giving you the power to own the only key to open them (some password of course not a real key), at the same time root may seem an strange concept its the most powerfull concept on a unix system.

talking about chown and chmod I would sticky with jschiwal, use man, dont make so simple questions, realy. We notice that you are very new to linux and you have to learn first to search for the answers on the net or in the man pages.
Man pages are simple tu use you just need to type in the console:
Code:
man SomeCommand
end you can go out from man pressing 'q'... or you follow this tip or you're going to find many rtfm (Read The Fu... full Manual) if you know what I mean


best rregards[]'s
 
Old 01-25-2009, 11:34 AM   #11
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,375

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by maginotjr View Post
root is the God on your system but you always can try to hide something from him, like using some tool like EncFS that Encryptate any folder giving you the power to own the only key to open them (some password of course not a real key), at the same time root may seem an strange concept its the most powerfull concept on a unix system.

talking about chown and chmod I would sticky with jschiwal, use man, dont make so simple questions, realy. We notice that you are very new to linux and you have to learn first to search for the answers on the net or in the man pages.
Man pages are simple tu use you just need to type in the console:
Code:
man SomeCommand
end you can go out from man pressing 'q'... or you follow this tip or you're going to find many rtfm (Read The Fu... full Manual) if you know what I mean


best rregards[]'s
Begging your pardon, but I'm not new to Linux. What I am is a 5 1/2 year-user with a comprehension level of an advanced newbie.
 
Old 01-25-2009, 11:43 AM   #12
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by newbiesforever View Post
Begging your pardon, but I'm not new to Linux. What I am is a 5 1/2 year-user with a comprehension level of an advanced newbie.
Me too.....

Yes, he was talking down to you.......
No, you are not the only person to suddenly realize that root can do anything---including reading, changing, and deleting all you data......

No, you should not get upset......
 
Old 01-25-2009, 12:17 PM   #13
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,375

Original Poster
Rep: Reputation: Disabled
I wasn't upset.--I'm better at brushing off geek taunts than I used to be. Actually, I was well aware of the concept that root is God--that's newbie knowledge to me. My question was only about chowning.

And you can't mean you're an "advanced newbie," because how would you be a mod. Unless you were patronizing me, you must mean you've used Linux for 5 1/2 years. It seems impressive to have become an apparent expert in such a relatively short time.

Last edited by newbiesforever; 01-25-2009 at 12:20 PM.
 
Old 01-25-2009, 05:22 PM   #14
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
mod != expert

many posts != expert

Seriously, I think what I have learned in the last 3+ years at LQ is a bit about where to look for things. I really doubt that I would be employable in the IT industry---that I will leave to the folks ~ 1/3 my age.

I am also lucky to have learned some Unix and some programming before wandering down the Windows path for well over 5 years.
 
Old 01-25-2009, 08:09 PM   #15
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by renjithrajasekaran View Post
So - You're telling me that an admin can simply chown any of the "restricted" files on my home folder and view them?

Seriously ???

Linux Archive
Yup. Root is the God in the Machine.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
chown rust8y Solaris / OpenSolaris 3 11-02-2007 04:04 PM
FC4 System Crash bcs chown -R named:named extend joangopan Fedora 1 09-09-2007 02:46 AM
chown -R named:named /var/named crash the system? joangopan Fedora 2 09-09-2007 02:46 AM
system down by chown demmylls Linux - General 2 11-22-2003 07:09 PM
chown? joetec Linux - Newbie 6 04-07-2002 04:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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