Hello, I was wondering if it were possible to automatically send a command to the server once a connection have been established.
I thought this was what pre/post exec were for, but whatever I enter there it does not execute on the remote server.
Is there a way to automatically send a command (ex: 'whoami') everytime a connection is established with a particular node?
Yes, PAC was built with that in mind! ;)
Simply edit your connection and goto to the "Expect" tab:
- click "Add"
- on "Expect", right click and choose <command prompt>
- on "Send", write your command (leave the rest of fields with their default values)
Save and try! :)
For me the expect tab is grey. I installed the expect package, and can run the expect command from the command line. Anything else I have to enable?
Hmmm... what? THAT'S weird...
What PAC version are you using?
What type of connection are you experiencing those problems? (ssh, telnet, ...)
I'm on 4.5.4, and it is a ssh session.
Can it be a permission problem such that pac does not see that expect is installed?
No, PAC has nothing to do with "Expect" package (it uses it's own Perl expect bindings, which are automatically installed).
Does that happen only on that connection, or on EVERY SSH connection??
Really, this is the first time I see someone with this problem... :(
Thanks for investigating. It does not work for any ssh connection, it is grey for all connections.
And I just found the: I have enabled manual authentication. This makes the expect tab grey.
It is kind of logical, but for me the 'manual' connection is established automatically. My ssh key is automatically sent on connection, don't know why. Thus my setup has manual authentication selected, but user 'root' specified under User/Password, although that option is not selected. I could not get it to work with any other combination.
If you have a clue how I should configure the connection parameters otherwise, let me know.
The behaviour for the other connection options is like this:
The connection to remote server is successfully established, and I can see the remote system's output and a command prompt. However, I cannot enter anything because PAC does not recognize the connection as established. The status indicator remains on 'Disconnected'.
The only way it works for me is: Select user/password as authentication method, enter user 'root' there, then change the authentication to manual. The root value remains in the user/password section greyed out, but I will be authenticated successfully with my key which is sent by default.
I understand that this disables the expect tab.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.