~/.ssh/rc Auto Login to seperate shell

129 Views Asked by At

Below is the codeblock which I use within my RC file. The idea is to move straight into another servers ssh session (without port forwarding). When this executes, I see the session. This said, it blinks rapidly and is not interactive. I believe this is by design, but, is there another way to call on the ssh command after a specific user logs in? If not, do you know a workaround to make the screen interactive? Thank you.

if [ ! -z "$SSH_CONNECTION" ]
then
ssh -i ~/.ssh/id_rsa [email protected]
fi
1

There are 1 best solutions below

0
On BEST ANSWER

The issue was that bashrc is called within ~/.profile appending the ssh connection to the end of the ~/.profile had fixed the problem.