Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > General

Reply
 
Thread Tools Display Modes
  #1  
Old 09-29-2018, 11:57 AM
MalcomR MalcomR is offline
Registered User
 
Join Date: Sep 2018
Location: Southern US
Posts: 2
Running command after login

I know this has been covered in several articles but for some reason it just doesn't work for me. I'm evaluating SecureCRT for possible use.

I want to connect to a Linux server (Centos 7) and run a command such as cd or ls after login. The remote command option runs a command and exits which is not what I want so I'm trying to use the login actions with Automate logon. I want to avoid having to write a script - not that I don't like scripting but given that the system has the command I need I want to use them.

Under expect I enter this (there is a space after the #.


]#

Under send I enter this for testing purposes.

ls

I connect and get this. If I execute ls from the command line after login I get a list of files in my home directory.

Last login: Sat Sep 29 12:46:36 2018 from 10.0.110.245


[userserver ~]#
[userserver ~]#
[userserver ~]#

So what am I doing wrong? From what I have read the command ls should execute after login once SecureCRT sees the expect string.

So far I am impressed with SecureCRT. I'm using something similiar but it's only for Linux and SecureCRT works on Windows and Linux so I can have one app. I also like the execute commands on multiple targets which the other app does but not as nicely.

Thanks.
Reply With Quote
  #2  
Old 09-30-2018, 10:46 AM
ekoranyi ekoranyi is offline
VanDyke Technical Support
 
Join Date: Jan 2017
Posts: 654
Hi MalcomR,

I'm sorry to hear you're having trouble. It sounds like you have the right idea about logon actions. As a quick test, does removing the trailing space from your expect string change the behavior you see?

If not, there is some additional information that would give me a better idea of what may be happening. First would be a screenshot of your Logon Actions category and the second is a log of a connection. PLEASE DO NOT POST THESE DIRECTLY TO THE FORUMS, instead please send these via email to Support@VanDyke.com with "ATTN Eric Forum Post 13268" in the subject line.

To create the log file choose File > Log Session before connecting to your server. You will need to select a file name/location. I suggest something ease to find such as SecureCRTLog.txt on your Desktop. Once you've configured the log file, attempt your connection again. When the Logon Actions fail please attach the resulting log for review.
__________________
Thanks,
--Eric

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 09-30-2018, 12:44 PM
MalcomR MalcomR is offline
Registered User
 
Join Date: Sep 2018
Location: Southern US
Posts: 2
Running command after login

Quote:
Originally Posted by ekoranyi View Post
Hi MalcomR,

I'm sorry to hear you're having trouble. It sounds like you have the right idea about logon actions. As a quick test, does removing the trailing space from your expect string change the behavior you see?

If not, there is some additional information that would give me a better idea of what may be happening. First would be a screenshot of your Logon Actions category and the second is a log of a connection. PLEASE DO NOT POST THESE DIRECTLY TO THE FORUMS, instead please send these via email to Support@VanDyke.com with "ATTN Eric Forum Post 13268" in the subject line.

To create the log file choose File > Log Session before connecting to your server. You will need to select a file name/location. I suggest something ease to find such as SecureCRTLog.txt on your Desktop. Once you've configured the log file, attempt your connection again. When the Logon Actions fail please attach the resulting log for review.
I've tried with and without a space so no difference. Let me get the screenshot and log files and email them to you.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 05:36 PM.