how to use ssh transport file in phpstorm - ssh

in my project , I only have ssh ,no ftp sftp and rsync, I write php script in phpstorm
but I have not found any plug about ssh in it.
I want develop on windows, so anyone know is there anyway to transport file to linux,
thank you everyone

Try using the scp command.
scp your_username#remotehost.edu:foobar.txt /some/local/directory

Related

Is it possible to edit code on my own machine and save it to account I've ssh'd into?

Scenario:
I'm using ssh to connect to a remote machine. I use the command line and run ssh <pathname>, which connects me to the machine at . I want to edit and run code on that remote machine. So far the only way I know is to create, edit, and run the files in the command window in vi, because my only connection to that machine is that command window.
My Question is:
I'd love to be able to edit my code in VSCode on my own machine, and then use the command line to save that file to the remote machine. Does anyone know if this is possible? I'm using OS X and ssh'ing into a Linux Fedora machine.
Thanks!
Sounds like you're looking for a command like scp. SCP stands for secure copy protocol, and it builds on top of SSH to copy files from one machine to another. So to upload your code to your server, all you'd have to do is do
scp path/to/source.file username#host:path/to/destination.file
EDIT: As #Pam Stums mentioned in a comment below the question, rsync is also a valid solution, and is definitely less tedious if you would like to automatically sync client and server directories.
You could export the directory on the remote machine using nfs or samba and mount it as a share on your local machine and then edit the files locally.
If you're happy using vim, check out netrw (it comes with most vim distributions; :help netrw for details) to let you use macvim locally to edit the remote files.

how do I download a file in my current directory in ssh?

I'm looking right at the file I want to download in my current directory. wget wants a FULL url, I don't know what the full url is. im in directory /usr/local/lib/ and want to download php.ini.
I am using putty to log into my web server, and when i say donwload i want to download it from the web server to my pc
Firstly, forget URLs, and forget wget - this file isn't going to be accessible over the world wide web (if it is, your security is seriously broken).
However, if you can see it on SSH, you can probably (depending on security policies on the server) access it by using the same credentials over SCP.
On the command-line, using the PSCP program which comes with PuTTY that would look something like:
pscp user#server.example.com:/usr/local/lib/php.ini .
Or you could use a graphical client like WinSCP or FileZilla (which supports SFTP, which is another SSH-based protocol; use sftp://server.example.com as the server to connect to), if you're on a Windows desktop.
Use pscp which is included with PuTTY
If you are on Linux:
scp user#server:/path2file/file path-on-localpc

How to copy files from source to target with a unattended bash script?

I want to copy files from a source to a target unattended via bash script. I do have options to use sftp, ftp over SSL, rsync, WebDAV, CIFS
I do not have the option to install a SSH key pair on the target side (Strato HiDrive), so scp and sftp won't work, do they?
I have read about a scp -W option to store the Password in a file, but can't find some detailed information about…
any ideas?
I think you have two questions here.
Q1 is how should you keep a copy of your files on a remote server. The answer to that is rsync over ssh.
Q2. how to supply a password to ssh when you can't put your key on the remote server. This is answered here:
how to pass password for rsync ssh command
Hope that helps.

Automatically run script/commands after connecting to OpenShift SSH

I set up an OpenShift application and set up my local PuTTY to connect to the server via SSH. Everything works fine, but I don't know how to run a few commands (mainly alias) after I connected to the server automatically (I don't want to copy&paste the same commands everytime I connect).
On my local linux shell I can use .bashrc, but this doesn't seem to work on OpenShift. I can't write a file in my home directory (/var/lib/openshift/[some letters and numbers]/) and I don't know the right place to put this file. Does anybody know where I have to put a file which will be run everytime I login?
I'd prefer a solution which doesn't involve my local SSH software as I'm connecting to this OpenShift application from different machines.
You can use your .bash_profile located in your $OPENSHIFT_DATA_DIR.
This has to be done in .bashrc or .profile or .bash_profile files. As you say they don't work then you can have a script in a file, scp that file to the remote server and then run when you ssh in a single command.
I have not used openshift but have used aws ec2 instances alot with ruby scripts,
ssh ubuntu#ec2-address ruby basic-auto.rb
The above command excutes the ruby file after the ssh. You can have a script in any language or may be a bash file(.sh) which executes after ssh.

copying the file from ssh

I have connected to a esxi server that I created using putty in windows. I want to capture the esxtop output in a csv file to open it with excel. But I can't find the capture.csv file. I looked around and found that I might have to use scp command.
I found this is the general syntax
scp local_file(s) user#hostname:destination_directory
now what will be the hostname here if I just want to copy capture.csv to a windows drive?
I think your question is about copying a file from Linux/UNIX to Windows. To achieve the functionality of scp there is a freeware called WinSCP, which u can use for copying files. Or create a share in Linux/UNIX side using Samba and the share folder can be accessed from Windows.
When I output files on an ESX host and need to get them into my windows environment, I just create them on the host itself in a directory on the same data-store as its drives and then connect from windows via WinSCP and FTP them to my local windows desktop.
Sadly, I don't think there is really a better way at this time.