LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-19-2006, 09:54 PM   #1
RajRed
Member
 
Registered: Mar 2005
Posts: 66

Rep: Reputation: 15
allow user to make directory


I created a new linux login account. When I login under this account, I got 'cannot create directory 'test': permission denied' when I tried to make a directory. How do I allow the new account able to make a directory?

Thanks.
 
Old 02-19-2006, 10:20 PM   #2
jcliburn
Member
 
Registered: Dec 2003
Location: Mississippi, USA
Distribution: Fedora
Posts: 435

Rep: Reputation: 33
Where are you trying to make this directory? In your home directory? When you set up the new account, what did you specify as your home directory?
 
Old 02-19-2006, 10:27 PM   #3
leandean
Member
 
Registered: Oct 2005
Location: Burley, WA
Distribution: Sabayon, Debian
Posts: 278

Rep: Reputation: Disabled
How did you create the new user account? When you log in are you in the user's home directory? That's the only place a non-privileged user can create a file or directory.
 
Old 02-20-2006, 12:46 PM   #4
RajRed
Member
 
Registered: Mar 2005
Posts: 66

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jcliburn
Where are you trying to make this directory? In your home directory? When you set up the new account, what did you specify as your home directory?
I used 'useradd' to create the account without specify the home directory, I think the default home directory was /home/userlogin, Is it correct I can only make directory under /home/userlogin?
 
Old 02-20-2006, 12:48 PM   #5
RajRed
Member
 
Registered: Mar 2005
Posts: 66

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by leandean
How did you create the new user account? When you log in are you in the user's home directory? That's the only place a non-privileged user can create a file or directory.
I used 'useradd' to create the account without specifing the home directory, I think the default home directory was /home/userlogin, when I login, it takes me to whichever the previous working directory I was in. Is it correct I can only make directory under /home/userlogin?
 
Old 02-20-2006, 12:52 PM   #6
jcliburn
Member
 
Registered: Dec 2003
Location: Mississippi, USA
Distribution: Fedora
Posts: 435

Rep: Reputation: 33
You can create a directory inside any directory having its permissions set to allow you to write in it.

You didn't say which directory you were in when you tried to create the test directory.
 
Old 02-20-2006, 01:03 PM   #7
RajRed
Member
 
Registered: Mar 2005
Posts: 66

Original Poster
Rep: Reputation: 15
I was in / directory login under a non-root user.
 
Old 02-20-2006, 01:21 PM   #8
jcliburn
Member
 
Registered: Dec 2003
Location: Mississippi, USA
Distribution: Fedora
Posts: 435

Rep: Reputation: 33
If you logged in as a non-root user, your home directory should not be "/"; it should be "/home/username" unless you've set up another home directory for that user. I suggest you delete that user account and recreate it, explicitly establishing the home directory in the proper place.
 
Old 02-20-2006, 01:45 PM   #9
RajRed
Member
 
Registered: Mar 2005
Posts: 66

Original Poster
Rep: Reputation: 15
If I reestablish the /home/username for a non-root user and login under this user, I can only make directory under /home/username, is it correct?
 
Old 02-20-2006, 04:32 PM   #10
jcliburn
Member
 
Registered: Dec 2003
Location: Mississippi, USA
Distribution: Fedora
Posts: 435

Rep: Reputation: 33
Quote:
Originally Posted by RajRed
If I reestablish the /home/username for a non-root user and login under this user, I can only make directory under /home/username, is it correct?
No, not strictly correct. A non-root user can create a directory in any directory in which he has write access, for example, /tmp.
 
Old 02-20-2006, 10:51 PM   #11
leandean
Member
 
Registered: Oct 2005
Location: Burley, WA
Distribution: Sabayon, Debian
Posts: 278

Rep: Reputation: Disabled
If you use the -m switch with useradd, it creates the home directory: /usr/sbin/useradd -m 'name'. Sorry about the mis-speak regarding what a user can write to
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
jail user to /home/user directory confused_user Linux - Security 12 03-15-2006 10:56 AM
what is the command to make a user change their password after creating a new user? naweenio Linux - Newbie 7 01-05-2005 08:07 AM
how do I make sure that the user that is going to run the script is a root user??? nikold01 Linux - General 3 09-10-2004 08:54 AM
permissions question... can I make a directory writable from my user account hindenbergbaby Linux - Newbie 9 10-20-2003 05:42 PM
Link user directory according to user id x2000koh Programming 1 07-24-2003 07:38 AM

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

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