LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 02-03-2012, 12:31 PM   #1
sunrised24
LQ Newbie
 
Registered: Jan 2012
Location: Chennai,INDIA
Distribution: Centos5.4,SuseLinux,Rhel5,Ubuntu 10.04
Posts: 27

Rep: Reputation: Disabled
How to change the root shell /sbin/nologin to /bin/bash by login as user


Dear All

Someone had changed the root user shell to /sbin/nologin .i login into server as user .How can i change the shell of root by loging as user acc.

Quote:
designer@xx~]$ su - root
Password:
This account is currently not available.
[designer@xx ~]$
Quote:

[designer@xx ~]$ sudo vi /etc/passwd

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

[sudo] password for designer:
designer is not in the sudoers file. This incident will be reported.
[designer@xx ~]$
Quote:

[designer@xxx~]$ ls -al /etc/passwd
-rw-r--r-- 1 root root 1750 Feb 3 14:05 /etc/passwd

chmod 777 /etc/passwd
chmod: changing permissions of `/etc/passwd': Operanntion not permitted


can someone help me how can i solve these

Last edited by sunrised24; 02-03-2012 at 12:43 PM.
 
Old 02-03-2012, 12:42 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 327Reputation: 327Reputation: 327Reputation: 327
Code:
$ su - root
The '-' in the above requests a login shell. Remove the '-' and use:

Code:
$ su root
Alternatively, boot a LiveCD or LiveUSB and make the change that way.
 
Old 02-03-2012, 12:49 PM   #3
sunrised24
LQ Newbie
 
Registered: Jan 2012
Location: Chennai,INDIA
Distribution: Centos5.4,SuseLinux,Rhel5,Ubuntu 10.04
Posts: 27

Original Poster
Rep: Reputation: Disabled
Hi macemoneta.


[designer@xx ~]$ su root

Password:
This account is currently not available
 
Old 02-04-2012, 12:58 AM   #4
cbtshare
Member
 
Registered: Jul 2009
Posts: 569

Rep: Reputation: 42
You should fix the root line by changing the shell from /sbin/nologin to /bin/bash
 
Old 02-04-2012, 01:02 AM   #5
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 189Reputation: 189
Quote:
Originally Posted by cbtshare View Post
You should fix the root line by changing the shell from /sbin/nologin to /bin/bash
Which you cant do without sudo if root has no been set to no shell..

As macemoneta suggested, use a live cd, and manually modify /etc/passwd
 
Old 02-04-2012, 04:01 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,552
Blog Entries: 54

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
...and if the system isn't yours then please ask the designated admin(s).
 
Old 02-04-2012, 06:04 AM   #7
devilboy09
Member
 
Registered: Nov 2011
Location: Iran
Distribution: Debian, CentOS, LFS
Posts: 351

Rep: Reputation: 7
use live cd to fix it.otherwise you're screwed !!!
 
Old 02-04-2012, 12:04 PM   #8
sunrised24
LQ Newbie
 
Registered: Jan 2012
Location: Chennai,INDIA
Distribution: Centos5.4,SuseLinux,Rhel5,Ubuntu 10.04
Posts: 27

Original Poster
Rep: Reputation: Disabled
Hi,
There is any other way to make users with root privileges without booting of live cd.Since im using vps server
 
Old 02-04-2012, 02:08 PM   #9
devilboy09
Member
 
Registered: Nov 2011
Location: Iran
Distribution: Debian, CentOS, LFS
Posts: 351

Rep: Reputation: 7
Quote:
Originally Posted by sunrised24 View Post
Hi,
There is any other way to make users with root privileges without booting of live cd.Since im using vps server
as far as i know, no.
 
Old 02-05-2012, 07:12 AM   #10
cbtshare
Member
 
Registered: Jul 2009
Posts: 569

Rep: Reputation: 42
contact the vps provider and let them know....
 
  


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
[SOLVED] How to change from /sbin/sh to /bin/bash for 'root'? thomas2004ch Solaris / OpenSolaris 2 02-20-2011 05:32 AM
How to change from /sbin/sh to /bin/bash for 'root'? thomas2004ch Linux - Software 2 02-19-2011 06:29 AM
Root ShelI Change - changed /etc/passwd /sbin/sh to /sbin/bash and gave No Shell mn35 Solaris / OpenSolaris 13 04-13-2010 05:24 AM
How to add paths to sbin, bin/bash, bin sh for users gopi.d Fedora 3 12-07-2007 01:47 AM
/bin/false vs /sbin/nologin - difference? ziggie216 Linux - General 1 12-22-2005 03:59 AM


All times are GMT -5. The time now is 10:35 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration