LinuxQuestions.org
Visit Jeremy's Blog.
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 01-27-2010, 06:31 AM   #1
cool_p17
LQ Newbie
 
Registered: Jul 2008
Location: mumbai
Posts: 4

Rep: Reputation: 0
Lightbulb giving ownership while creating directories


Is there any way by which one can give ownership while creating directories itself. It should be one command otherwise it requires root login to change ownership of a directory.
 
Old 01-27-2010, 06:39 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
I believe that only root can change ownership of files or directories. (This seems logical to me.)

Take a look at "man mkdir" for what options are available when creating a directory.
 
1 members found this post helpful.
Old 01-27-2010, 06:42 AM   #3
samsom
LQ Newbie
 
Registered: Jan 2009
Posts: 27

Rep: Reputation: 15
You have to be root to change ownership of any file...I think. I might be wrong. If not, then any user can change the ownership of his files to someone else.
Samsom

Pixellany beat me to it....damn my slow internet connection!
 
Old 01-27-2010, 06:51 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by samsom View Post
If not, then any user can change the ownership of his files to someone else.
Samsom
Or---worse yet, from someone else to his---or to yet another person. Not good.....
 
Old 01-27-2010, 09:01 AM   #5
sohail0399
Member
 
Registered: Oct 2008
Location: Pakistan, Islamabad
Distribution: CentOS, Fedora, Solaris
Posts: 154

Rep: Reputation: 23
first you have to make directory then change user permission, there may be other solution also.

instead of root admin user can also do this with the help of sudo command in centOS.
 
  


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
Default ownership of files and directories linuxdevil Linux - Security 4 06-02-2011 06:25 AM
How to inherit group ownership from directory when creating a file wastingtime Linux - Software 3 11-24-2009 08:06 PM
Creating a Linux Distribution and ownership gacott Linux - General 9 04-25-2006 04:24 PM
Changing ownership of directories; /var/log/messages questions Micro420 Linux - General 6 04-21-2006 08:39 PM
ownership of directories cwolf78 Linux - Software 3 05-08-2005 11:37 PM

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

All times are GMT -5. The time now is 06:33 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration