LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-22-2011, 01:35 AM   #1
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271
Blog Entries: 7

Rep: Reputation: 18
Problems while switching to root user


Hi all,

I have a remote server and direct root access is disabled in that server for security reasons.So i first use to login as normal user and then switch to root user.

But the problem is when i login as normal user it logins with no problems,but when i switch to root user it prompts for root password and after giving the password it takes too much time around 2-3 minutes to login as root user.

Not sure what is exactly happening there, I have checked the processes and load through root user,every thing seems to be normal but could not identify the problem.

Your suggestions please.

Thanks in advance,
Dinesh.

Last edited by dinakumar12; 08-22-2011 at 01:47 AM.
 
Old 08-22-2011, 05:53 AM   #2
salemeni
Member
 
Registered: Aug 2011
Posts: 64

Rep: Reputation: Disabled
Quote:
Originally Posted by dinakumar12 View Post
Hi all,

I have a remote server and direct root access is disabled in that server for security reasons.So i first use to login as normal user and then switch to root user.

But the problem is when i login as normal user it logins with no problems,but when i switch to root user it prompts for root password and after giving the password it takes too much time around 2-3 minutes to login as root user.

Not sure what is exactly happening there, I have checked the processes and load through root user,every thing seems to be normal but could not identify the problem.

Your suggestions please.

Thanks in advance,
Dinesh.
To execute a command with root privileges do :
Code:
$ sudo you command
generics array

Last edited by salemeni; 12-06-2011 at 03:02 AM.
 
Old 08-22-2011, 08:50 AM   #3
timur91
Member
 
Registered: Aug 2011
Posts: 42

Rep: Reputation: Disabled
What's your OS?

Do you get anything in /var/log/secure or /var/log/auth.log? Are your DNS resolvers working properly?
 
1 members found this post helpful.
Old 08-22-2011, 09:05 AM   #4
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271

Original Poster
Blog Entries: 7

Rep: Reputation: 18
Hi,

Thanks, My DNS resolvers were working properly and my /var/log/secure is clean no unauthorized logins.

my server is running centos.
 
Old 08-23-2011, 12:10 PM   #5
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
Maybe it’s a sleep command in root’s ~/.bashrc
 
Old 08-23-2011, 01:04 PM   #6
timur91
Member
 
Registered: Aug 2011
Posts: 42

Rep: Reputation: Disabled
Quote:
Originally Posted by timur91 View Post
What's your OS?

Do you get anything in /var/log/secure or /var/log/auth.log? Are your DNS resolvers working properly?
please post your /etc/ssh/sshd_config file. If PAM auth is used please try to disable that.

Please try to enable direct root login and try to login as root directly without switching. Is the delay still there?

java socket

Last edited by timur91; 01-05-2012 at 05:31 AM.
 
Old 08-23-2011, 02:46 PM   #7
Zatarra
LQ Newbie
 
Registered: Aug 2011
Posts: 8

Rep: Reputation: 0
I agree with Reuti, it may be a .bashrc problem (usually executs a script that takestime to run or stuff like that). Do not hesitate to check the .profile/.bash_profile too (in case you use su -).
 
Old 08-29-2011, 04:59 AM   #8
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271

Original Poster
Blog Entries: 7

Rep: Reputation: 18
Hi all,

Sorry for the delay, my .bashrc file seems to be normal.Actually the problem occurs only at the very first time when i switch as root user.

Then the second or next time if i switch to root user the process is fast and i can able to switch immediately as root.

If my bashrc is the problem i should face this problem all the time when switching to root right?
 
Old 08-29-2011, 05:55 AM   #9
ozanbaba
Member
 
Registered: May 2003
Location: İzmir
Distribution: Slackware64 15.0 Multilib
Posts: 778

Rep: Reputation: 135Reputation: 135
Let's not forget global /etc/profile as well.
 
  


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] sudo is not switching to root, running as same user instead thebombzen Linux - Software 4 05-15-2011 10:50 AM
MySQL Root User problems nitro_punk85 Linux - Server 2 10-17-2007 08:52 PM
switching between user and root without logging out redhat_marsi Linux - Newbie 7 06-13-2005 10:38 AM
Switching between root and user PapaNoHair Slackware 14 07-28-2003 12:58 PM
Non-root user problems natto34 Linux - General 1 07-16-2002 01:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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