LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 07-01-2012, 09:46 PM   #1
scottjsn
LQ Newbie
 
Registered: Nov 2010
Posts: 16

Rep: Reputation: 0
switch user issue


Prepare for installation of Oracle 11g R2 on SUSE Linux Enterprise Server 11 R2. First I logged in as root, then created a user named oracle (with its password). Next I tried to switch to user oracle:

#su - oracle

Supposedly I am now oracle user. But when I check the current user for the session, it is still the root, not oracle.

I tested:

echo $USER
or
last | grep $USER
or
env | grep -i user

They all returned: root

Why so?


Now start a new session, and login as oracle, the error message states:

xsession: login for oracle is disabled.

What was wrong here?



Thanks to help

Scott

Last edited by scottjsn; 07-01-2012 at 10:18 PM.
 
Old 07-01-2012, 09:54 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

testing environment variables, is not really the way to go.
What do "whoami" and "id" (or "id -u") return?

Evo2.
 
Old 07-01-2012, 10:22 PM   #3
scottjsn
LQ Newbie
 
Registered: Nov 2010
Posts: 16

Original Poster
Rep: Reputation: 0
Both "whoami" and "id" returned: root
 
Old 07-01-2012, 10:57 PM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

what procedure did you use to create that user?

Can you check the uid of the user "oracle". You should be able to do that with the following command:
Code:
grep oracle /etc/passwd
Evo2.
 
Old 07-02-2012, 09:16 AM   #5
scottjsn
LQ Newbie
 
Registered: Nov 2010
Posts: 16

Original Poster
Rep: Reputation: 0
what procedure did you use to create that user?

#/usr/sbin/useradd -u 502 -g oinstall -G dba oracle
#passwd oracle
...
...


#grep oracle /etc/passwd
oracle:x:104:107:Oracle user:/opt/oracle:/bin/false

How could I ended up with /bin/false?

Last edited by scottjsn; 07-02-2012 at 09:39 AM.
 
Old 07-02-2012, 06:14 PM   #6
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

the /bin/false is the shell for the user oracle and that is why you cant log in (su - oracle) as that user. I'm not sure why that is the shell though. Normally if you don't specify the shell when using useradd the default shell which is set in /etc/default/useradd is used.

Is there any reason you used useradd instead of adduser? adduser is usually the better option (check the man pages of both commands).

Evo2.
 
  


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
[SOLVED] Switch user from one simple user to another. sevs Linux - Security 4 07-07-2011 09:10 AM
LXer: Ubuntu 8.04 to 10.04 - reader provides the 'right' switch, but why is this even an issue? LXer Syndicated Linux News 0 08-18-2010 06:10 PM
Router -> firewall -> switch issue Chris594 Linux - Networking 3 09-10-2007 07:25 PM
switch user vannus Linux - Newbie 4 02-19-2006 10:16 PM
Switch user spotslayer Linux - Software 2 09-18-2004 04:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

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