4

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.

How can I do this?

slm
  • 369,824

1 Answers1

3

The ".bashrc" file is only processed within "interactive shells". There are multiple question around the Stack Exchange network:

There are two options for you: modify bash settings on the server or startup your ssh command with a prefix.

domi27
  • 169