I need to do SSH to a remote server by expanding servername and user from the variables. I tried several ways but couldn't get thru the script.
hardcoded servername and user which was working as expected.
ssh imp_user\@servername1Note: '@' is required
Passing variables to ssh for servername and user as below
$user_name ='imp_user' $server_name ='servername1' "ssh '$server_name".'@'."$server' "-- but no luck
$user_name ='imp_user' $server_name ='@servername1' ssh $user_name\\$server_name-- no luck