Find the answer to your Linux question:
Results 1 to 5 of 5
Hello, I recently upgraded a FreeBSD box from 6.3 to 7.4, however, I didn't realise the requirement of compat6x before the final upgrade install. It leaves Bash broken because of ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2006
    Posts
    25

    How to switch Shell over SSH?


    Hello,

    I recently upgraded a FreeBSD box from 6.3 to 7.4, however, I didn't realise the requirement of compat6x before the final upgrade install.

    It leaves Bash broken because of a failed dependency (Shared object "libncurses.so.6" not found, required by "bash")

    Which means I can't login either at the console or via SSH because it dumps me out immediately after logging in. I am the only Wheel user with my default shell set as Bash. I know /bin/sh is unaffected by this because I can log into via the console as root and roll back the upgrade. Second time of upgrading the same problem, but I have no access to the console this time to roll it back.

    How can I log in via SSH using a different shell from Bash so I won't be dumped out? I can't log in as root via SSH because of the security and I am the only member of the Wheel group.

    Any help will be very useful.

    Thanks
    Will

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,356
    From the man page: "If command is specified, it is executed on the remote host instead of a login shell."

    So maybe this will do the trick?
    Code:
    ssh <USER>@<HOST> /bin/sh
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Nov 2006
    Posts
    25
    Hi,

    Thanks, I did try that yesterday and again just now but it still dumps me out with the same error.

    Any other suggestions?

  4. #4
    Linux Newbie hans51's Avatar
    Join Date
    May 2011
    Posts
    136
    unconventional but may be possible

    upload via rsync (or scp) your missing
    libncurses.so.6
    to the correct path/folder from your laptop to the server
    if it is but that one file missing, then it may work

  5. #5
    Linux Enthusiast
    Join Date
    Jan 2005
    Location
    Saint Paul, MN
    Posts
    629
    Quote Originally Posted by Irithori View Post
    From the man page: "If command is specified, it is executed on the remote host instead of a login shell."

    So maybe this will do the trick?
    Code:
    ssh <USER>@<HOST> /bin/sh
    Yes, this is the way to run a different shell (or any command.) The problem is that "/bin/sh" is most likely a symbolic link to "/bin/bash".

    Another option for a shell is to not use a standard shell. For example "/bin/vim", which lets you issue commands via the
    Code:
    :!commandline complete with arguments
    So try:
    Code:
    ssh <USER>@<HOST> /bin/vim
    Other possible non-shell alternatives:
    Are other shells installed? Other ideas are is telent or ftp installed. Running them via ssh might work as they allow executing commands on the local machine which would be the server when you connect via ssh to execute the command.
    Last edited by alf55; 07-10-2011 at 08:10 PM. Reason: added vim

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •