8 Useful Tips & Tricks for SecureCRT

SecureCRT is powerful, high-usability terminal emulator.
I found some useful tips & tricks when using SecureCRT, which are summarized below.

Copy & Paste

When using terminal window, we often need to copy & paste text content.
In SecureCRT, we can easily copy and paste text with one click of the mouse.

Color Scheme

SecureCRT has multiple color schemes built in, and we can create/edit Custom Color Schemes.

We can also find shared color schemes on GitHub.

Keyword Highlighting

Keyword highlighting allows us to focus on specific text content.

We need to create a keyword highlighting profile.

Regular expressions are based on the syntax used in Python. We can also use shared configuration files. The configuration file directory is in %appdata%\VanDyke\Config\keywords, the suffix is .ini. Download the configuration file on the official website or GitHub, then overwrite the configuration file.

The following is the configuration file I am using. Unfortunately, the source is no longer known, so I don’t know who the sharer is.

D:"Match Case"=00000000
Z:"Keyword List V2"=00000016

If we need to display the color, we need to check the color option.

My SecureCRT window looks like this.

Scrollback Buffer

The default Scrollback Buffer on SecureCRT is 500, but 500 lines are not enough in many situations such as show tech or show run.

We can adjust the Scrollback Buffer up to 128000.

Anti Idle

The Anti Idle function on SecureCRT can be used to prevent the Telnet/SSH client session automatically disconnecting due to timeout.

Many computer protocols, such as telnet, include a NOP command that a client can issue to request a response from the server without requesting any other actions. Such a command can be used to ensure the connection is still alive or that the server is responsive.

NOP protocol commands

Importing SecureCRT Sessions

Usually we can manually add SecureCRT Sessoins, but sometimes we need to add a lot of Sessoins. SecureCRT scripts are used to perform automated tasks, and importing Sessions is one of them.

We can download the script here and import the pre-edited CSV file. Note that the file must be saved as ANSI, otherwise the task will fail.

The available fields are as follows.

session_name The value that will be used for the session’s name. If this field does not exist, the hostname field is used as the session_name.
folder A relative folder path for the specified session (not including the session name) as displayed in the Session manager. Any folder that does not exist will be automatically created as the script runs.
hostname Required. The hostname or IP address for the remote server.
protocol Required. The protocol to be used for connecting with the session (SSH2, SSH1, Telnet, or RLogin).
port The port on which the remote server is listening.
username Username for the account on the remote server.
emulation The emulation (vt100, xterm, etc.).
description Comment/description. Multiple lines are separated with \r.

The result after executing the script is as follows.

Auto Save Session Logs

We can use SecureCRT to automatically save logs to improve efficiency.

For the log file name, the available variables are as follows.

%H – hostname (not valid with protocols that do not specify a host, such as Serial)
%S – session name
%Y – four-digit year
%y – two-digit year
%M – two-digit month
%D – two-digit day of the month
%P – port (not valid with protocols that do not specify a port, such as RLogin)
%h – two-digit hour
%m – two-digit minute
%s – two-digit seconds
%t – three-digit milliseconds
%F – directory path starting below the “Sessions” folder
%% – percent (%)
%envvar% – environment variable

SecureCRT will automatically save logs whenever we connect to Telnet/SSH.

The result looks like this.

Upload & Download

SecureCRT supports Zmodem protocol, we can use SecureCRT to upload or download files.

Install lrzsz on the server.

root@yang-explorer-1:~# apt install lrzsz
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
Use 'apt autoremove' to remove it.
Suggested packages:
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 25 not upgraded.
Need to get 74.8 kB of archives.
After this operation, 531 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu eoan/universe amd64 lrzsz amd64 0.12.21-10 [74.8 kB]
Fetched 74.8 kB in 1s (66.4 kB/s)
Selecting previously unselected package lrzsz.
(Reading database ... 155145 files and directories currently installed.)
Preparing to unpack .../lrzsz_0.12.21-10_amd64.deb ...
Unpacking lrzsz (0.12.21-10) ...
Setting up lrzsz (0.12.21-10) ...
Processing triggers for man-db (2.8.7-3) ...

Use sz to download files and rz to upload files.

root@yang-explorer-1:~# mkdir test
root@yang-explorer-1:~# cd test
root@yang-explorer-1:~/test# rz
rz waiting to receive.
Starting zmodem transfer.  Press Ctrl+C to cancel.
Transferring devices.csv...
  100%     190 bytes  190 bytes/sec 00:00:01       0 Errors  

root@yang-explorer-1:~/test# ls
root@yang-explorer-1:~/test# sz devices.csv
Starting zmodem transfer.  Press Ctrl+C to cancel.
Transferring devices.csv...
  100%     190 bytes  190 bytes/sec 00:00:01       0 Errors  



Example: Import Keyword Highlighting INI File
SecureCRT Text Highlighting
How to setup automatic session log on SecureCRT
Keep SecureCRT SSH Sessions from Disconnecting
Importing SecureCRT® Sessions from a Data File
Example: Import Arbitrary Data From File To SecureCRT Sessions
Overview of Color Configuration in SecureCRT®
NOP protocol commands

Update on September 17, 2021

If you want to open the ssh:// or telnet:// link with SecureCRT by default in the browser, you may need to change the registry.




"C:\Program Files\VanDyke Software\Clients\SecureCRT.EXE" /T %1

1 Response

  1. August 24, 2021

    […] 8 Useful Tips & Tricks for SecureCRT […]

Leave a Reply

Your email address will not be published.