LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 12-09-2017, 12:05 AM   #1
cr27
LQ Newbie
 
Registered: Dec 2017
Posts: 2

Rep: Reputation: Disabled
Superuser login issue after changing shell to ssh


I wanted to change my Fedora shell to ssh.
I used the chsh command and then gave the address /bin/ssh. Logout the superuser. But after login as su, I am unable to login and getting this issue:-

/*Issue*/
<pre>usage: ssh [-1246AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
[-D [bind_address:]port] [-E log_file] [-e escape_char]
[-F configfile] [-I pkcs11] [-i identity_file]
[-J [user@]host[:port]] [-L address] [-l login_name] [-m mac_spec]
[-O ctl_cmd] [-o option] [-p port] [-Q query_option] [-R address]
[-S ctl_path] [-W host:port] [-w local_tun[:remote_tun]]
[user@]hostname [command]</pre>

//The terminal echoes current shell as bash.

Last edited by cr27; 12-09-2017 at 12:08 AM.
 
Old 12-09-2017, 03:34 AM   #2
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,817

Rep: Reputation: 1211Reputation: 1211Reputation: 1211Reputation: 1211Reputation: 1211Reputation: 1211Reputation: 1211Reputation: 1211Reputation: 1211
ssh is a ssl-secured remote shell invocation utility, not a login shell!
Login shells are sh,bash,ksh,zsh,ash,dash,...
Most LUnix have a list of the allowed login shells in /etc/shells, that prevents picking a wrong shell.

Looks like you have locked out root.
You can try
Code:
sudo chsh
and change to /bin/sh
If that fails you need to boot a rescue system.

Last edited by MadeInGermany; 12-09-2017 at 03:47 AM.
 
Old 12-09-2017, 08:45 AM   #3
username_11011
Member
 
Registered: Nov 2017
Location: Odessa, TX
Distribution: slackwarearm
Posts: 30

Rep: Reputation: Disabled
Path to file with default user shells:
Code:
/etc/passwd
You'll find the following line (or similar):
Code:
root:x:0:0::/root:/bin/ssh
Change that to:
Code:
root:x:0:0::/root:/bin/bash
P.S., if you *really* want to use ssh as your default shell (not sure why, ssh is for logging in to shells on other machines on a network), you can ssh to your local machine by using ssh like this:
Code:
ssh root@127.0.0.1
However, ssh will use root's default shell as it's default shell. I'm confused. Maybe you meant "/bin/sh"??
 
Old 12-14-2017, 10:35 AM   #4
giis
Member
 
Registered: Nov 2013
Location: Third Rock from Moon
Distribution: RPM/DEB based and LFS
Posts: 73

Rep: Reputation: Disabled
Can you share the exact command you tried?
 
  


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] Linux login shell not changing for GNOME terminal in CentOS 7 shijm Linux - Newbie 4 05-06-2016 07:55 AM
Graphical Login issue after changing /etc/profile.d Pir Ovais Linux - Newbie 8 11-16-2011 06:15 PM
Changing SSH login tag? nectron101 Linux - General 2 01-30-2005 09:21 AM
Changing SSH remote login look untwisted Linux - Software 2 03-14-2004 12:50 PM
changing my default shell after login? Quartzophobia Linux - General 1 02-11-2004 11:36 AM

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

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