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?
ssh serverAlias runcomman
does find aliases from.bashrc
. Is this not working? What is your login shell on the server (ssh serverAlias 'ps $$'
)? – Gilles 'SO- stop being evil' Nov 30 '13 at 17:497493 ? Rs 0:00 ps 7493
– ahmedelgabri Dec 02 '13 at 05:45ssh serverAlias 'ps $$'; alias
, then – Gilles 'SO- stop being evil' Dec 02 '13 at 09:50