Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I execute a command every time after ssh'ing from one machine to another?

Tags:

ssh

How do I execute a command every time after ssh'ing from one machine to another?

e.g

ssh mymachine
stty erase ^H

I'd rather just have "stty erase ^H" execute every time after my ssh connection completes.

This command can't simply go into my .zshrc file. i.e. for local sessions, I can't run the command (it screws up my keybindings). But I need it run for my remote sessions.

like image 546
someguy Avatar asked Nov 14 '08 02:11

someguy


1 Answers

Put the commands in ~/.ssh/rc

like image 165
geocar Avatar answered Sep 16 '22 13:09

geocar