Results 1 to 8 of 8

Thread: Different shell with SSH?

  1. #1
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,401

    Different shell with SSH?

    Allright, I need a bit of help.. I kind of screwed up... And I don't want to drive an hour to change it locally..

    I'm working on a OpenBSD machine remotely.. Somewhere along the line ldconfig fsck'd up..
    Now when I try to login with ssh I get the message "bash: can't load library 'libintl.so.2.0'".

    Is there a way to change my shell to /bin/sh remotely so I can login again?

    I've tried ssh remote.system /usr/bin/chsh, ssh remote.system /bin/sh and a few more I could think of. They all respond with the same error message..
    Oliver's Law:
    Experience is something you don't get until just after you need it.

  2. #2
    Senior Member BrainStop's Avatar
    Join Date
    Jan 2002
    Posts
    295
    SirDice,

    From my foggy memories, any login command (ssh or telnet or ...) will run the shell specified in your user profile. Thus, if you are set to use bash, it will start bash to execute your remote command.

    Do you have any other user account on the machine not configured to use bash?

    Not much help ... but maybe the only way to go.

    Cheers,

    BrainStop
    "To estimate the time it takes to do a task, estimate the time you think it should take, multiply by two, and change the unit of measure to the next highest unit. Thus we allocate two days for a one-hour task." -- Westheimer's Rule

  3. #3
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,401
    Originally posted here by BrainStop
    Do you have any other user account on the machine not configured to use bash?
    Only root but I cannot use it remote

    I've also tried ssh remote.system "LD_LIBRARY_PATH=/usr/lib:/usr/local/lib /bin/sh" but that too fails
    Oliver's Law:
    Experience is something you don't get until just after you need it.

  4. #4
    Senior Member
    Join Date
    Jul 2004
    Posts
    469
    Do you happen to have any other services running? Maybe FTP or Samba? You could download and modify the necessary files and then upload them back to the system.

  5. #5
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,401
    Unfortunately SSH is the only service running on that machine...
    Scp and sftp both didn't work as they both needed bash?!?

    I even tried things like echo /usr/bin/chsh | ssh remote.host 'cat > ~/.ssh/rc' and ssh remote.host /bin/sh -k 'sudo -s'.. Nothing worked..

    Fortunately we found someone at the hosting company willing to help.. So the problem is solved

    But I would still like to know if it's even possible. For future reference
    Oliver's Law:
    Experience is something you don't get until just after you need it.

  6. #6
    Jaded Network Admin nebulus200's Avatar
    Join Date
    Jun 2002
    Posts
    1,356
    Are any of the commands you are trying to run actually running ? I don't see how you would be able to execute any commands via SSH if the logon/scp isn't working because its always going to look at /etc/passwd for your shell and try to run it...

    If for some reason it is working, have you tried setting up a tunnel, like for X ?
    xhost +localhost
    ssh -XCAY user@<remotehost> xterm &

    Another thought...happen to have netcat installed ?
    There is only one constant, one universal, it is the only real truth: causality. Action. Reaction. Cause and effect...There is no escape from it, we are forever slaves to it. Our only hope, our only peace is to understand it, to understand the 'why'. 'Why' is what separates us from them, you from me. 'Why' is the only real social power, without it you are powerless.

    (Merovingian - Matrix Reloaded)

  7. #7
    Senior Member Maestr0's Avatar
    Join Date
    May 2003
    Posts
    604
    If SSH itself needs bash (using your /etc/passwd shell) to run things you may be screwed, you might try starting a telnet daemon, but again, if ssh uses bash to execute the commands its passed you're screwed.


    -Maestr0
    \"If computers are to become smart enough to design their own successors, initiating a process that will lead to God-like omniscience after a number of ever swifter passages from one generation of computers to the next, someone is going to have to write the software that gets the process going, and humans have given absolutely no evidence of being able to write such software.\" -Jaron Lanier

  8. #8
    Senior Member
    Join Date
    Sep 2001
    Posts
    1,027
    Have you tried running an sftp / scp session and uploading a new passwd file?
    Just a guess but that might bypass the need for the shell...


    Ammo
    Credit travels up, blame travels down -- The Boss

Posting Permissions

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