Putty shortcut and ssh to another server question, possible in bash?

Hi,

sorry if this is the wrong forum for this question but I couldnt spot another obvious forum for it.

I have a windows shortcut which opens up a saved session in putty. From this session I then ssh to another remote server. I was wondering is there a way that I can either edit my shortcut so that it brings up my saved session then automatically runs the ssh command to the other server, or is there a way I can do it through my bash profile or something?

Just to add, I have to go via the saved session to connect to the other server because of networking reasons.

Thanks for your help.

yeah you can do by bash startup files. test it out !!

Hi, I did think about it a bit more but then I realised, if everytime I log onto remote server1 and its bashprofile tells me to ssh2 to remote server2, then I wont be able to actually log into server1...as it will keep forwarding me on.

Hmm, maybe I can make an alias shortcut for the ssh command to remote server 2.

Whatever those networking reasons are must be among the settings for that PUTTY option.

PUTTY, being an interactive graphical terminal, isn't meant to be automated in that fashion. For that, there's it's companion PLINK utility.

Hi Corona, I think the reason is that there is some sort of firewall on server2 so it will only accept connections from server1 rather than directly from my computer.

I have got a shortcut on putty which automatically loads up server1 when i run it but I dont think I can add more arguments to the shortcut so it opens server1 then server2.

I've found some people use alias for ssh shortcuts though. I might try that.

That's what I mean. The PUTTY terminal emulator is interactive, not meant to be automated. They made the PLINK utility to do automatic things, but it's not graphical.

That'd make things simpler at least. just 'doserver2' instead of ssh username@server2 thing1 thing2 ...