...
Edit or create ~/.ssh/config
Code Block Host teton Hostname teton.uwyo.edu User USERNAME ForwardAgent yes ControlMaster auto ControlPath ~/.ssh/ssh-%r@%h:%p
If you create the config file, it seems to be recommended to modify permissions of this file so that only user can read and modify it
chmod 600 ~/.ssh/config
Connect to Teton in your terminal using
ssh teton
, provide your password and validate with 2FA. KEEP THIS TERMINAL WINDOW OPEN.Now you can lauch as many multiple sessions on Teton using
ssh teton
in new terminal windows, and (a must!) you can transfer files between your machine and Teton without providing password! For synchronizing files/directories between machines, you can usersync -av teton:PATH_TETON PATH_USER_MACHINE
Once done, exit Teton on all terminals and close the windows. Next time you do
ssh teton
you will have to provide your password.
Thanks to Alex Buerkle who shared this tip!