-
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"
Dont work for me PERMANENTLY
After sourcing the .sh it work, but when you close & reopen terminal, it wont work anymore
Not on a SSH, i'm using a VM with debian 12
It's so much better to just do it in
~/.bash_aliases