LinuxQuestions.org
Help answer threads with 0 replies.
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 02-03-2012, 11:31 AM   #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 11:43 AM.
 
Old 02-03-2012, 11:42 AM   #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: 344Reputation: 344Reputation: 344Reputation: 344
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, 11:49 AM   #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-03-2012, 11:58 PM   #4
cbtshare
Member
 
Registered: Jul 2009
Posts: 645

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

Rep: Reputation: 193Reputation: 193
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, 03:01 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

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

Rep: Reputation: 10
use live cd to fix it.otherwise you're screwed !!!
 
Old 02-04-2012, 11:04 AM   #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, 01:08 PM   #9
devilboy09
Member
 
Registered: Nov 2011
Location: Iran
Distribution: Debian, CentOS, LFS, CloudLinux
Posts: 377

Rep: Reputation: 10
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, 06:12 AM   #10
cbtshare
Member
 
Registered: Jul 2009
Posts: 645

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


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

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

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