-
Create a file in /etc/profile.d/ directory
- myAlias.sh
-
Define the alias in the file
alias gotoserver1="ssh [email protected]"
-
Give right permission to the file
chmod 755 myAlias.sh
-
Restart SSH session exiting terminal and opening a new one (or use source /etc/profile.d/myAlias.sh)
-
To create an alias permanently add the alias to your .bashrc file
sudo vi ~/.bashrc
-
And then add your alias at the bottom
alias ls="ls -l"
If you want it permanent which is what the tile says ( Add permanent aliases in Linux CentOS ) should we also finish with
source ~/.bashrc