Home > Shell Scripting, Tools, UNIX > Personalizing your connection to QA/Production environments with SecureCRT

Personalizing your connection to QA/Production environments with SecureCRT

The trouble with production/QA environments is that you can rarely change them to fit you personal preferences, and usually you use a common user to access them.
If you are working on Windows and using SecureCRT to connect to Linux/Unix machines (and if not – ask yourself why …) you can personalize any connection to QA/Production environments by telling SecureCRT to perform automatic login activities – this without effecting how the machine behaves for other users.
By personalization I am referring to the definition of your personal aliases etc.

How to do it:

  1. Download this VBScript to your computer, and place it somewhere (e.g. C:\Utils\SecureCRT\Scripts)
  2. Find a connection you want to effect in SecureCRT and open it’s properties
  3. Navigate to Connection -> Logon Actions
  4. Check the Logon script checkbox and type the path to the file defined at the beginning (e.g. C:\Utils\SecureCRT\Scripts\EnvironmentPersonalizer.vbs)

Every time you login – SecureCRT will run that script.

What the script does:
The way this scripts works is that it waits for something to happen on the screen and then sends commands.

objTab.Screen.WaitForString("$")   // Wait for the prompt
objTab.Screen.Send "bash" & vbcr   // Switch to a BASH shell
objTab.Screen.Send "clear" & vbcr   // clear the screen
objTab.Screen.Send "alias ll='ls -lart'" & vbcr   // Alias 'll' to be 'ls –lart' 

You can find a few more utility scripts on my Github Repository – https://github.com/ronkitay/SecureCRT-Environment-Personalization

Note: Take great care when effecting anything on production environments – don’t do anything that will effect how the environment behaves for other people (like changing the .bash_profile for example)

Categories: Shell Scripting, Tools, UNIX Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: