Skip to main content
edited tags
Link
Gilles 'SO- stop being evil'
  • 865.9k
  • 205
  • 1.8k
  • 2.3k
Tweeted twitter.com/#!/StackUnix/status/268382808823713794
Source Link
user490123
  • 183
  • 1
  • 6

Run ssh login command without modifying remote .bashrc

We have a bunch of servers set up with set -o vi in their ~/.bashrc.

It would be nice to be able to ssh into these boxes and automagically run set -o emacs as a timesave.

I've seen a solution indicating that such additions should be made on the remote host ~/.bashrc but we cannot modify these for various reasons.

Another solution suggests using:

spawn ssh -t user@host "set -o emacs; /bin/bash -i"

..but I understand this requires running the expect shell instead of plain bash.

Is there a simple way to achieve this goal? Any suggestions would be very much appreciated.