I want to create a shell script, that automates the login procedure with my terminal to my university servers. the official procedure is: use ssh to login into a login-server of the Uni. From the login-server, use ssh to a PC-pool computer -> do your stuff there. You are not allowed to do any "heavy" computing on the login servers.
When using just my terminal, the command series is:
user@home:ssh -X user@loginServer.uni.de
#here i am being asked for my password
user@loginServer:ssh -X pcName
#no password req. here
user@pcName:cd Documents
#exemple one command to execute.
Right now, i have created a small script, that just does the first two steps: logging in to both servers and providing a terminal to me (but without using the -X option, so I can't start programs with a GUI).
#!/usr/bin/bash
sshpass -p 'user' ssh -t user@loginServer.uni.de "ssh user@pcName"
But now I'd like to also execute some basic commands on the second pc, like moving into a directory and still having the terminal after that to further work on the pc, and hopefully be able to start programs with User interfaces..
And yes, I know it's not secure to safe your password in plain text in a script. I am quite a noob with such scripts and do this more as a feasibility study than as an important routine.