Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > SecureCRT on the Mac

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-20-2011, 09:32 PM
chuckmdonaldson chuckmdonaldson is offline
Registered User
 
Join Date: Mar 2011
Posts: 10
Logon Action not working

I have added a simple logon action to do the following:

expect: #
send: bash

It is not working. Nothing happens. Any ideas?

I am running 6.7.1.
Reply With Quote
  #2  
Old 07-21-2011, 01:23 AM
MrC MrC is offline
Registered User
 
Join Date: Mar 2004
Posts: 216
Are you trying to automatically launch the bash shell as a sub-shell immediately upon login?

You are likely already running bash, and auto-entering bash just starts a new shell. Type 'exit' once logged in. If my theory is correct, only the sub-shell exits and you're still connected.
Reply With Quote
  #3  
Old 07-21-2011, 08:03 AM
chuckmdonaldson chuckmdonaldson is offline
Registered User
 
Join Date: Mar 2011
Posts: 10
Yes, I am trying to automatically launch a bash sub-shell upon logging in. It is definitely not working.

I am logging in as root and the shell is ksh. Bash does not get executed.

I also have two ways of logging into these servers. One way is through a jump box in which I use an expect script and it all works fine. The second way is direct via VPN using logon actions and this is where I am having the problem.
Reply With Quote
  #4  
Old 07-21-2011, 08:40 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi chuckmdonaldson,

Do you actually see "bash" appear in the terminal window where you would expect it to appear?

If not, then you may need to wait for something that is more unique than "#".

Can you post the output that you see when attempting to connect to this remote device?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #5  
Old 07-21-2011, 08:44 AM
chuckmdonaldson chuckmdonaldson is offline
Registered User
 
Join Date: Mar 2011
Posts: 10
Nothing actually happens.

Here is what I have to choose from when I log in, after the @ symbol is the hostname and will change from server to server.

[root@akrsupcrfp01: / ]
#
Reply With Quote
  #6  
Old 07-21-2011, 09:02 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi chuckmdonaldson,

Since you do not see the word "bash" appear after the "#", it is likely that the command is being sent prior because the "#" character appears more than once.

Since the Expect/Send functionality is so limited, you may want to consider using a Python script to accomplish your goal.

You could wait for "[root@" or ": / ]" if those are unique strings that do not appear prior to the prompt. You would then wait for the "#", and then you would send "bash" followed by a carriage return.

Have you considered using a Python login script rather than the Expect/Send sequence?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #7  
Old 07-21-2011, 10:16 AM
MrC MrC is offline
Registered User
 
Join Date: Mar 2004
Posts: 216
Hmmm, why not just change your login shell?

Or, why not add a command in your ksh profile that exec's bash, but only for the interactive login shell?
Reply With Quote
  #8  
Old 07-21-2011, 10:44 AM
chuckmdonaldson chuckmdonaldson is offline
Registered User
 
Join Date: Mar 2011
Posts: 10
I have tried several things in the expect sequence.

#
root
: / ]

None of them work and they are unique.

I have not considered python as I am not familiar with that scripting language and this should be fairly simple to setup.
Reply With Quote
  #9  
Old 07-21-2011, 10:53 AM
MrC MrC is offline
Registered User
 
Join Date: Mar 2004
Posts: 216
Have you moved your rule to the top of the list (or removed the default login and password entries)? These work in order. This works fine for me here.
Reply With Quote
  #10  
Old 07-21-2011, 11:03 AM
chuckmdonaldson chuckmdonaldson is offline
Registered User
 
Join Date: Mar 2011
Posts: 10
Quote:
Originally Posted by MrC
Hmmm, why not just change your login shell?

Or, why not add a command in your ksh profile that exec's bash, but only for the interactive login shell?
I can't do the above things as these are customer servers and I don't have the authority to do so.
Reply With Quote
  #11  
Old 07-21-2011, 11:46 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi chuckmdonaldson,

Understandable. We often find that the shell cannot be changed for this reason.

Would you be able to send a raw log reflecting the complete manual connection process when connecting to a server using the VPN?

If so, here are the steps to generate a raw log:
  1. Before connecting with the session, select Raw Log Session from SecureCRT's File menu.
  2. In the Select Log File dialog, choose a folder and filename in which you would like the log text to be stored and click the Save button. At this point, if you open the File menu, you will notice that Raw Log Session now has a check-mark next to it; this indicates that raw logging is activated.
  3. Now connect to the remote machine and perform the actions which cause the reported problem to occur.
  4. Disconnect the session and select Raw Log Session from the File menu to turn off the raw log feature.
  5. Browse to the location of the raw log file and attach it to your message.
What operating system are you using where SecureCRT is installed?

Would you also send the complete Expect/Send sequence you are using (please remove any sensitive data)?

Please send this to support@vandyke.com with a subject of Attn: Todd - Forum thread 8579.
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #12  
Old 07-21-2011, 11:57 AM
chuckmdonaldson chuckmdonaldson is offline
Registered User
 
Join Date: Mar 2011
Posts: 10
RESOLVED!!!

Thank you! The issue was the default login/password entries.
Reply With Quote
  #13  
Old 07-21-2011, 12:07 PM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi chuckmdonaldson,

I am glad to hear that MrC's suggestion resolved the issue.
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
Reply


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

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 01:35 PM.