how can we write a simple regular function which i can put in my bashprofile which can be used to secure console to any host i want.
but my secure console has to go through a jump host. that is the issue.
function func_name () {
ssh jumphostname;
sc $hostname # from jump host secure console to another host given as input from terminal
}
this function only making to login in to jump host but not to secureconsole in to another host from there.
-bash-4.1$func_name host.me.com should give me console to host.me.com via jumphost
is function for this not possible? do i have to write a script?
Here's how I do it.
Example
mkdir ~/.functions
echo '#!/bin/bash
echo $1' > ~/.functions/ekho
echo 'alias ekho="sh ~/.functions/ekho"' >> ~/.bash_profile
source ~/.bash_profile
Now you can call your method from any location for ever ever.
ekho "Wow"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With