Visit Our UNIX and Linux User Community


Can't login as SU anymore - SU: NO SHELL


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Can't login as SU anymore - SU: NO SHELL
# 1  
Old 04-21-2006
Error Can't login as SU anymore - SU: NO SHELL

the root shell has been changed in the file /etc/passwd, basically pointing to an incorrect directory. So now every time we login as 'su' I get the message
'su: no shell' so we can't login as superuser.

Is there an easy way to rectify this? please use step by step instructions/commands -

I know one way is to boot off a cd on the machine in single mode and then mount the root dir and then change the file...but I'm unsure about the command line. Is there any other way? I've tried linking the path, but permission rights stopped this.
# 2  
Old 04-22-2006
Hi

Try if u can change roots shell in /etc/passwd file, if any root currently log in, else try to machine in single user mode and mount the /, then change roots shell.

Awadhesh
# 3  
Old 04-22-2006
If you have permissions, you can copy the shell to the "incorrect location"... what is the full path of the shell in /etc/passwd now?
# 4  
Old 04-24-2006
permissions dont allow me to copy bash to the 'incorrect dir'.
in /etc/passwds it's set to /sbin/bash but should have been /usr/bin/bash.
# 5  
Old 04-24-2006
Have run into this before. The only thing that we could do was reboot.
1. reboot from cdrom
2. mount the '/' filesystem as /a
3. vi /a/etc/passwd and change the shell to the required value
4. save and exit
5. reboot from disk
 

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script as login shell (passing args to login shell)

Hello all, for security reasons my compagny imposes that my script be launch remotly via ssh under the users login shell. So serverA launches the ssh command to serverB which has a local user with my script as a login shell. Local script works like a charm on his own. serverB$ grep... (20 Replies)
Discussion started by: maverick72
20 Replies

2. UNIX for Dummies Questions & Answers

Which of the following command displays your login shell in bash shell?

Options:: A)$shell B)echo $ bash C)echo $ O D)$ O (1 Reply)
Discussion started by: raghugowda
1 Replies

3. Slackware

Anyone Using Slackware Anymore?

We used to use Slackware, but then moved all our servers to Ubuntu Linux. Does anyone use Slackware anymore? (8 Replies)
Discussion started by: Neo
8 Replies

4. Shell Programming and Scripting

Pause shell script till folder doesn't change size anymore

Hi, I recently would like to write a shell script that 1. Runs in the background (can be done with "&", but i'd be happy for other solutions to keep programs running) 2. Does its stuff 3 THEN checks a specified folder for a size change over time (say, each 5 seconds. AND ONLY continues with... (9 Replies)
Discussion started by: pasc
9 Replies

5. Windows & DOS: Issues & Discussions

Can't login to Vista anymore

hello obviously something got messed up and I can't login to my Vista account anymore. the password was automatically disabled hence it was directly booting into vista. then I installed openSSH and created a password for the user. But vista login doesn't recognize this password and now I can't... (6 Replies)
Discussion started by: milhan
6 Replies

6. UNIX for Dummies Questions & Answers

Input of char 's' is not possible anymore

Hello, I have a big problem and no idea how to solve it. I was looking up commands in /bin with 'man' as I found 'sh'. In mistake I started the command. Now after that I can not input the character 's' in shell anymore! Even after restarting system the problem is still there. Mysterious... (7 Replies)
Discussion started by: daWonderer
7 Replies

7. UNIX for Dummies Questions & Answers

Can't SSH as root anymore!

I've screwed something up in my sshd_config apparently, because I can't ssh with root anymore. I had disabled root login for security reasons, but then my ssh credentials with full administrative privelges stopped working. So then I reenabled root login (and reset ssh), but root now isn't... (3 Replies)
Discussion started by: cquarry
3 Replies

8. Linux

How to Start a Shell as Login shell instead of ordinary shell

Hi I tried with bash --login option. but the output is siva:~$ bash --login siva:~$ is there any way to make the shell ask for user id and password ( and login as different user instead of using sudo / su ) Thx in advance Siva (3 Replies)
Discussion started by: Sivaswami
3 Replies

9. HP-UX

cannot login after changing login shell

Hello Everyone, I am a newbie in unix. I was practicing shell scripts on hp unix machine. I changed my current login shell (Korn) to Bourne shell giving the following command. $ chsh username /usr/bash I am using secure shell client for accessing the hp ux server. After which i... (4 Replies)
Discussion started by: hardesh
4 Replies

Featured Tech Videos