Putty launch command line

Author: Axxx Date of post: 10.07.2017

I'm using PuTTY to remotely log onto my school's host. Upon logging in, we are required to do these steps:. I will be logging into this host a lot over the course of this semester and I was hoping to create a script that would eliminate the redundancy of the above steps. Ignoring the obvious security oversights of having my password in the script, how would I achieve this?

putty launch command line

I have zero experience with scripting, so your feedback is greatly appreciated. I played around with the command-line options for Putty and I was able to bypass steps using:. When I try to add this option to the command-line using the -m option, it looks like PuTTY logs into the host and then immediately exits.

windows 7 - A putty shortcut that automatically launches a profile? - Super User

Is there a way to keep my session open after running the shell file or am I using the -m option wrongly? Here is a link to a PuTTY guide that I have been following: Figured this out with the help of a friend. The -m PuTTY option will end your session immediately after it executes the shell file.

command line - PuTTY scripting to log onto host - Stack Overflow

What I've done instead is I've created a batch script called putty. This logs me in remotely to the Linux host. On the host side, I created a shell file called sql with these contents:. My host's Linux build used tcsh. Other Linux builds might use bashso simply replace tcsh with bash and you should be fine.

I'm not sure why previous answers haven't suggested that the original poster set up a shell profile bashrc. The quest that brought me to this page for help was a bit different -- I wanted multiple PuTTY shortcuts for the same host that would execute different startup commands.

Mostly they only differ in color schemes -- I like to have each group of related tasks share a color scheme in the terminal window, with critical tasks, like logging in as root on a production system, performed only in distinctly colored windows.

The folder's Windows properties are set to very clean and stripped down -- it functions as a small console putty launch command line shortcut icons for each of my frequent remote PuTTY and RDP connections. This runs the scripted command in my case just printing "Hello, world" on the terminal and sets a variable that my remote session can interact with. From Putty master session not "edit settings" from existing session load a saved config and in the SSH tab set remote command to:.

It should also be possible to have bash skip my. When you use the -m option putty does not allocate a tty, it runs the command and quits. If you want to run an interactive script such as a sql clientyou need to tell it to allocate a tty with -tsee 3. You'll avoid keeping a script on the server, as well as having to invoke it once you're connected.

I want to suggest a common solution for those requirements, maybe it is a use for you: With that program, you can write scripts on top of any window like Putty and execute all commands you putty launch command line to like button pressing or mouse clicking in textboxes or buttons.

There is an option to run a script. If it does not work, make sure that wait period before typing is a high value or increase that value. You can use the -i privatekeyfilelocation in case you are using a private key instead of password based.

By posting your answer, you agree to the privacy policy and terms of service. Stack Overflow Questions Developer Jobs Documentation beta Tags Users.

ssh - PuTTY: Run a remote command after login & keep the shell running - Super User

Sign up or log in to customize your list. Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings mbank mforex konkurs policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us. Log In Sign Up. Join the Stack Overflow Community.

putty launch command line

Stack Overflow is a community of 7. Join them; it only takes a minute: PuTTY scripting to log onto host Ask Question. Upon logging in, we are required to do these steps: I played around with the command-line options for Putty and I was able to bypass steps using: Here is the total command that I am trying to run from the command-line: Still no answer to keeping session open after using the -m command?

This is rather ridiculous that the session closes. If anyone wanted the session to close, they could have easily added the exit command to the script they are passing to the -m command. It is developed by same team as puttyexcept that it's command line version, instead of GUI. On the host side, I created a shell file called sql with these contents: To summarize, automating these steps are now done in two easy steps: This opens PuTTY and logs me into the host.

Run command tcsh sql. This adds the oracle tool to my host, and logs me into the sql database. In my opinion, tcsh and csh need to DIAF. I came up with two solutions, both of which worked: From Putty master session not "edit settings" from existing session load a saved config and in the SSH tab set remote command to: Here's what I'm using to connect to mysql from a batch file: This way you can emulate all steps you are always doing with Putty.

Desty 1, 8 Configuring it in the GUI does not imply that it can't be used from the CLI. All those settings will be applied when that session name is supplied to putty. Aftershock 2, 3 37 Sign up or log in StackExchange. Sign up using Facebook. Sign up using Email and Password.

Post as a guest Name. Stack Overflow works best with JavaScript enabled. MathOverflow Mathematics Cross Validated stats Theoretical Computer Science Physics Chemistry Biology Computer Science Philosophy more 3. Meta Stack Exchange Stack Apps Area 51 Stack Overflow Talent.

Rating 4,4 stars - 320 reviews
inserted by FC2 system