37
8
What I'm trying to do: start a PuTTY session from the command line, login to remote machine and cd
to provided directory.
putty.exe -agent -ssh some.host
That will open a session & login with my default login name & private key.
echo cd /some/remote/path/ > c:/stuff/cmd.txt
putty.exe -agent -ssh some.host -m 'c:/stuff/cmd.txt'
That will open a session, login, execute a command (cd
in this case) and exit.
How do I open a session, login, cd
and keep the session open?
Background: I use emacs under windows and often edit files on remote Unix machines using tramp & plink. I want to make a hotkey that opens a PuTTY session for that remote machine and chdirs to the directory of that file. Not a big deal on emacs side, but I'm stuck with PuTTY.
Thanks for the guideline here, but I seem to have an issue trying to use putty
– Vincent De Smet – 2014-09-24T06:00:54.183-m "myfile.sh" -t
to connect to a tinycorelinux vm (/bin/ash). I will get following error: http://i.imgur.com/QN5oRXC.png (my script starts withecho ".."
it will always show the first letter in my script after the illegal charactersif I use configure a remote command in the putty profile, it works – Vincent De Smet – 2014-09-24T06:02:50.860
I tried that (adding /bin/bash to cmd.txt) and that does not work. As far as I understand, bash starts in non-interactive mode and, having no code to execute, exits. Is there a way to start an interactive shell that way? – Artyom V. Kireev – 2013-04-25T16:20:44.460
Meanwhile, I tried to start mc. :-) It didn't, and provided some output:
Cannot get terminal settings: Invalid argument (22) TERM environment variable needs set.
– Artyom V. Kireev – 2013-04-25T16:21:15.617