Shortcut/tool to open terminal and ssh into remote server

Is it possible to create a shortcut/tool where with one click, it will open PHPStorm's Terminal and ssh into a remote server? Bonus if it can execute a php file or shell script on the remote server as well.

0
Hello,

Sure, you can configure an external tool. 

Settings | Tools | External Tools | "+"

Linux example is:
---
Program:         /usr/bin/ssh
Arguments: ssh root@203.0.113.1 -p22 -t "/usr/bin/php /path/to/script.php"
---

Then call it via Tools | External Tools | "Tool Name"

If you're on Windows/Mac, program and arguments fields are to be edited in accordance with OS specific commands.
0

@Stefan lakubov Thank you, I've tried using remote external tool but the issue is the tool opens with Run Tool Window instead of the Terminal Window, the script I'm running on the remote server is interactive and it doesn't work correctly in Run Tool Window.

I found a way to do it in Run/Debug Configurations with shell script 
ssh -t user@server -p port ‘/usr/bin/php /path/to/script.php; bash -l’
but this seems to be local to each project, is there a way to make it global?

0

Hello,

Tools can be global, yet if an interactive shell is required, you're right to use Run Configuration instead. 

However, as of now, there is no way to make Run Configuration it global. However, you can create a template: 

 

Alternatively, you can create a “sample project” with a pre-configured configuration and copy it when you create a new one.

Also, you're welcome to file a feature request (add the possibility of making those public) here: https://youtrack.jetbrains.com/projects/wi/issues

1

请先登录再写评论。