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 05-24-2010, 12:53 PM   #1
arun17reddy
LQ Newbie
 
Registered: May 2010
Posts: 9

Rep: Reputation: 0
How do i create a folder or directory if permissions are denied?


i just installed RHEL 5, when iam trying to create a directory or file
it is not creating ...can anyone please help me
thank you
 
Old 05-24-2010, 12:55 PM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Create the directory as root, or as the user with enough permissions.
 
Old 05-24-2010, 12:55 PM   #3
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Can you post the exact command and errors you get? Where are you trying to create them? Are you trying to create them as root or a normal user?
 
Old 05-24-2010, 01:05 PM   #4
fbt
Member
 
Registered: May 2010
Distribution: Chakra
Posts: 89

Rep: Reputation: 26
Quote:
Originally Posted by repo View Post
Create the directory as root, or as the user with enough permissions.
and if you want access by the user change the permissions to allow while root.
 
Old 05-24-2010, 02:24 PM   #5
cyber-monk
LQ Newbie
 
Registered: Feb 2005
Location: Earth
Distribution: Ubuntu, Fedora
Posts: 4

Rep: Reputation: 0
You can use sudo command (if your current user account is on the sudoers list). To add your account to the sudoers list switch to the root user (if you don't have the root password your system admin will need to do this for you, or give you the password).

Adding your account to the soders list

$> su
Password: [enter root password]


(where username is your user account name)

#> echo 'username ALL=(ALL) ALL' >> /etc/sudoers
#> exit (don't forget to exit root account)


Now that your account is in the sudoers list you can create a
directory or file using sudo
$> sudo mkdir <dir name> (make a directory)
$> sudo touch <file name> (make a file)
 
Old 05-24-2010, 02:52 PM   #6
hilyard
Member
 
Registered: Jan 2010
Location: Inland PNW
Distribution: Lite | siduction
Posts: 291

Rep: Reputation: 66
for ex.-- change ownership recursively to everything in /usr/local

Ctrl-Alt-F2 (NOTE: Ctrl-Alt_F7 to get back)
PHP Code:
su -
(or, if no root passwd deignated yet,
PHP Code:
sudo passwd root 
, then, afterward, either su or sudo)
-- You are now root, if all went well --
-- Go to directory/file just before where permissions are to be changed, like /usr/local --
PHP Code:
cd /usr 
-- the command <chmod> changes permissions, while <chown> changes ownwership--
PHP Code:
pwd 
(returns /usr)
PHP Code:
chown -R name:group ./local
(where "name" is user name desired to own all within /usr/local; "group" likewise)
-- Check it out by
PHP Code:
cd /local ls -al 
--

http://www.tuxfiles.org/linuxhelp/cli.html should help, too

"you can lead a horse to water . . . "
 
Old 05-24-2010, 03:46 PM   #7
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
for ex.-- change ownership recursively to everything in /usr/local
I don't think it's a good idea to change the ownership from /usr/local
 
Old 05-24-2010, 04:00 PM   #8
hilyard
Member
 
Registered: Jan 2010
Location: Inland PNW
Distribution: Lite | siduction
Posts: 291

Rep: Reputation: 66
This was just an example Why is it not a good example, then?
 
  


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
Folder Permissions :: Access denied for user 'www-data'@'localhost' own3mall Linux - Software 5 08-09-2009 06:52 PM
Why am I denied permission when I try to create a directory? toastyjsd Linux - Newbie 2 02-28-2009 06:49 PM
Access Denied to create folder fedoraman Linux - Newbie 1 02-16-2008 10:03 AM
Permissions denied - changing directory rust8y Solaris / OpenSolaris 1 08-08-2006 07:22 PM
permission denied if I want to create new folder dodo1983 Linux - Newbie 2 08-14-2004 10:46 PM

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

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