LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 07-09-2009, 09:04 AM   #1
nataloi
Member
 
Registered: Apr 2009
Distribution: Linux version 2.6.25-14.fc9.i686 (mockbuild@) (gcc version 4.3.0 20080428 (Red Hat 4.3.0-8) (GCC) )
Posts: 30

Rep: Reputation: 15
su - account unavailable error


Hello All,

I am trying to su to another username and I am getting account unavailable message, I have edited the sudoers file and also cannot gain access with command not found error. I know roots password since I am the only user on this machine - can anyone advise or help me out?

[naloi@dns Download]$ sudo nagios
[sudo] password for root:
sudo: nagios: command not found
[naloi@dns Download]$ sudo nagios
[sudo] password for root:
sudo: nagios: command not found

[naloi@dns Download]$ su nagios
Password:
This account is currently not available.

[naloi@dns Download]$ su
Password:
[root@dns Download]#
 
Old 07-09-2009, 09:09 AM   #2
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 69
Quote:
Originally Posted by nataloi View Post

[naloi@dns Download]$ su nagios
Password:
This account is currently not available.

[naloi@dns Download]$ su
Password:
[root@dns Download]#
Could you post the output of
grep nagios /etc/passwd
? Or, just check that this account has a valid shell (last entry).
 
Old 07-10-2009, 01:13 PM   #3
nataloi
Member
 
Registered: Apr 2009
Distribution: Linux version 2.6.25-14.fc9.i686 (mockbuild@) (gcc version 4.3.0 20080428 (Red Hat 4.3.0-8) (GCC) )
Posts: 30

Original Poster
Rep: Reputation: 15
[root@dns mep]# grep nagios /etc/passwd
nagios:x:495:491::/var/spool/nagios:/sbin/nologin

I am assuming that nologin is what is preventing me from su to this user...hmm ok - not sure why it has no login ability - is there a way to change this?
 
Old 07-10-2009, 02:55 PM   #4
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 69
Yes, set the shell to any valid one in your system, preferably to /bin/bash
You can do it with the usermod command or even by editing /etc/passwd directly.
 
Old 07-10-2009, 04:09 PM   #5
karamarisan
Member
 
Registered: Jul 2009
Location: Illinois, US
Distribution: Fedora 11
Posts: 374

Rep: Reputation: 55
That said, if nagios's shell was set to nologin, there's a reason for it - probably because that account will be running network services and if it's compromised, the attacker still doesn't have a shell. What do you need to do? If you have root, you shouldn't need to su to nagios.
 
Old 07-13-2009, 08:30 AM   #6
nataloi
Member
 
Registered: Apr 2009
Distribution: Linux version 2.6.25-14.fc9.i686 (mockbuild@) (gcc version 4.3.0 20080428 (Red Hat 4.3.0-8) (GCC) )
Posts: 30

Original Poster
Rep: Reputation: 15
yea, I need to look into it further, I did edit etc/passwd file, I am not concerned about it yet since this is just a trial. I wanted to su to nagios to test something as the nagios user. funny thing I was getting an error about starting the service too once I made the user able to login (via etc/passwd) the service started to work properly.

thanks for everyone's help
 
Old 07-13-2009, 11:49 AM   #7
karamarisan
Member
 
Registered: Jul 2009
Location: Illinois, US
Distribution: Fedora 11
Posts: 374

Rep: Reputation: 55
If that was all you needed, you should have said so. : ) That's actually what sudo does - literally, switch-user-do. The default just happens to be root. Try `sudo -u nagios whoami` - will work even if nagios can't log in.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
CUPS error : Service unavailable cjagdish69 Linux - Server 3 02-06-2009 01:32 AM
usb_bulk_read() - open error 11 Resource temporarily unavailable GSMD Programming 0 10-24-2006 01:07 AM
Squid error Http/1.1service unavailable AQG Linux - Networking 1 09-28-2006 04:31 AM
server-error-service-unavailable lpr printing TheBrick Linux - General 1 07-11-2006 07:04 AM
Sendmail Error Deferred: Resource temporarily unavailable shawnbishop Linux - Software 3 03-19-2006 01:00 PM

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

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