LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 01-14-2013, 08:52 AM   #1
thiyagusham
Member
 
Registered: Apr 2012
Posts: 213

Rep: Reputation: Disabled
Create the new user’s home dir in /home


Hello to all ;

PHP Code:
# useradd usr1 -d  /home/oracle/
cd /home/oracle/
-
bashcd: /home/oracle/: Permission denied 
From usr1 how can i enter other users home path.
I mean i have some files under 'home/oracle. From usr1
i want to read some files in /home/oracle.

when creating user , even i set other user home path
why i cant enter into oracle home? I know some permission
problem missing here? how can i resolve ?
 
Old 01-14-2013, 08:58 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Is there an "oracle" login already there?
Is it owned by that oracle login?
Is the group for the oracle login set?
Is the user in the same group?
Is the group access mode on the oracle directory permit access?

It is very rarely a good idea to have two users with the same UID, and that is implied by setting the users home directory to /home/oracle when that directory is owned by an existing user.

As I recall, all that is necessary is to be able to read/execute some scripts from the oracle login (mostly for configuration information). All that requires is rx on other access.
 
Old 01-14-2013, 09:14 AM   #3
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
What is permission mode on /home/oracle and it's group? Generally a normal user do not have write permission on /home directory, so you cannot create any sub-directory or file in it. To do so switch to root user.

Meanwhile, if you just want to read files inside /home/oracle, then add main group of this directory to your user account. And do chmod on this dir. as follow:-
Code:
~$ usermod -G <group> <your_username>
~$ chmod -R g+rw /home/oracle
 
1 members found this post helpful.
Old 01-14-2013, 12:44 PM   #4
thiyagusham
Member
 
Registered: Apr 2012
Posts: 213

Original Poster
Rep: Reputation: Disabled
Hello Geeks ;

Still i am getting Error. oracle user already logged in.

Quote:
$ whoami
oracle
$ id
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)
Quote:
# userdel -r usr1
# useradd -g oinstall usr1
# chmod -R g+rw /home/oracle/
# su - usr1
$ cd /home/oracle/
-bash: cd: /home/oracle/: Permission denied
$ id
uid=563(usr1) gid=500(oinstall) groups=500(oinstall)
 
Old 01-14-2013, 01:17 PM   #5
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
What is the output of
Code:
ls -ld /home/oracle
 
Old 01-14-2013, 02:19 PM   #6
thiyagusham
Member
 
Registered: Apr 2012
Posts: 213

Original Poster
Rep: Reputation: Disabled
Hi to all

Output for /home/oracle

Quote:
$ whoami
oracle
$ ls -ld /home/oracle
drwxrw---- 29 oracle oinstall 4096 Jan 15 00:02 /home/oracle
 
Old 01-14-2013, 03:27 PM   #7
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
You need to add execute permissions for the group

Code:
chmod g+x /home/oracle
or
Code:
 chmod 770 /home/oracle
 
1 members found this post helpful.
Old 01-14-2013, 03:53 PM   #8
thiyagusham
Member
 
Registered: Apr 2012
Posts: 213

Original Poster
Rep: Reputation: Disabled
Ya ,i got it ! Done.

Quote:
# useradd -g oinstall usar2 -d /home/oracle
su - usr2
$ pwd
/home/oracle
 
Old 01-14-2013, 04:34 PM   #9
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
You do realize this gives the user delete privileges to any files in the oracle directory.

Normally it would be rwxr-x for group permissions which would prevent such deletions.
 
1 members found this post helpful.
  


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
How to create new folders on P2 & P3 and how to mount /home dir on a folder on P3? AnApproach2DigestLinux Linux - Newbie 2 12-07-2012 02:38 AM
[SOLVED] Not able to create folder in home dir as root user vedaprasad Linux - Newbie 5 04-17-2012 04:34 AM
user home dir doesn't create when new user add dev_mohamed Linux - Software 3 01-12-2007 01:08 AM
useradd does not create a home dir leupi Ubuntu 3 12-12-2005 07:35 PM
HELP! When I create a new user a home dir isn't created lynchpin9 Linux - General 5 01-18-2005 11:05 AM

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

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