LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   How to change the root shell /sbin/nologin to /bin/bash by login as user (http://www.linuxquestions.org/questions/linux-server-73/how-to-change-the-root-shell-sbin-nologin-to-bin-bash-by-login-as-user-927437/)

sunrised24 02-03-2012 12:31 PM

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

macemoneta 02-03-2012 12:42 PM

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.

sunrised24 02-03-2012 12:49 PM

Hi macemoneta.


[designer@xx ~]$ su root

Password:
This account is currently not available

cbtshare 02-04-2012 12:58 AM

You should fix the root line by changing the shell from /sbin/nologin to /bin/bash

fukawi1 02-04-2012 01:02 AM

Quote:

Originally Posted by cbtshare (Post 4593384)
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

unSpawn 02-04-2012 04:01 AM

...and if the system isn't yours then please ask the designated admin(s).

devilboy09 02-04-2012 06:04 AM

use live cd to fix it.otherwise you're screwed !!!

sunrised24 02-04-2012 12:04 PM

Hi,
There is any other way to make users with root privileges without booting of live cd.Since im using vps server

devilboy09 02-04-2012 02:08 PM

Quote:

Originally Posted by sunrised24 (Post 4593722)
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.

cbtshare 02-05-2012 07:12 AM

contact the vps provider and let them know....


All times are GMT -5. The time now is 05:10 PM.