Skip to content

Instantly share code, notes, and snippets.

@ahmedelgabri ahmedelgabri/gist:7673970
Last active Dec 29, 2015

Embed
What would you like to do?
How can I run a bash alias on a server from my local machine?

On my laptop

Inside ~/.ssh/config file I have this

Host <serverAlias>
    HostName 127.0.0.1 #Server IP
    User <username>
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/id_rsa

On the server

Inside ~/.bashrc I have this alias alias runcomman="ls -al"

What I want to do is

In my terminal I want to type ssh <serverAlias> <something> to ssh into the server & run the alias on the server, so how can I do this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.