#1
|
|||
|
|||
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. |
#2
|
|||
|
|||
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. |
#3
|
|||
|
|||
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. |
#4
|
|||
|
|||
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? |
#5
|
|||
|
|||
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: / ] # |
#6
|
|||
|
|||
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? |
#7
|
|||
|
|||
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? |
#8
|
|||
|
|||
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. |
#9
|
|||
|
|||
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.
|
#10
|
|||
|
|||
Quote:
|
#11
|
|||
|
|||
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: 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. |
#12
|
|||
|
|||
RESOLVED!!!
Thank you! The issue was the default login/password entries. ![]() |
#13
|
|||
|
|||
Hi chuckmdonaldson,
I am glad to hear that MrC's suggestion resolved the issue. |
![]() |
Thread Tools | |
Display Modes | |
|
|