-1

I wanted to change my default Fedora bash shell to ssh (as a superuser).

So, using chsh command gave the address /bin/ssh. Logout the superuser. But after login as su, I am unable to login and getting this issue:-

Issue

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]

Moreover, the terminal echoes current shell as bash.

2
  • 7
    What made you want to do this? ssh is not a login shell, it is a way to access the shell on a remote machine.
    – jesse_b
    Commented Dec 9, 2017 at 18:56
  • What do you mean by "after login as su"? You don't login as su (unless you've created a user called su). You might login as root, or you might login as a normal user and then run su. Or you might be doing something else entirely. Commented Dec 9, 2017 at 21:24

1 Answer 1

4

You seem to be talking apples and oranges. Bash, csh, zsh, etc are shells. Secure Shell (SSH) is a communication protocol (and program) for connecting to remote computers. SSH connects you to a shell running on a remote computer, but is not itself a shell. This is why trying to set /bin/ssh as your shell fails.

2
  • Technically sshd IS a ptty though and the client ssh is technically a shell that forwards all commands via the ssh protocol to a ptty on the remote machine.
    – jdwolf
    Commented Dec 9, 2017 at 20:00
  • The SSH client may forward commands via the SSH protocol to a ptty on a remote machine, but the SSH client is not a shell itself. A shell is run on the remote machine to actually interact with. Running the SSH client executable itself (as displayed in the question) does not start any type of shell environment without arguments. If you do add arguments to connect to a machine, then you're no longer using it as a "shell" on the existing account and machine, but to connect to either a different account on the same machine or a different machine all together.
    – Jason Rush
    Commented Dec 9, 2017 at 20:15

Not the answer you're looking for? Browse other questions tagged .