PHPStorm unable to connect to svn+ssh repository on windows - windows

I'm attempting to use PHPStorm's built-in VCS functionality on a windows machine. When I set it up to utilize svn+ssh, I get the following error:
Problems while loading file history: svn: E170012: Unable to connect to a repository at URL 'svn+ssh://user#svr/repo_path/trunk'
svn: E170012: Can't create tunnel
svn: E720087: Can't create tunnel: The parameter is incorrect.
The repository information is correct and I don't have any issues connecting via TortoiseSVN. I've attempted to configure it utilizing both TortoisePlink.exe and putty's plink.exe. I've used both Pageant and tried to provide the key at the command line.
I normally work with OS X and Linux environments, but that's not an option in this case and I'm not exactly sure what to check next and I'm not finding a lot online via google search. Any suggestions would be greatly appreciated.

I ran into the same issue and found this path to the solution: How to use svn+ssh with Tortoise SVN from the command line
In context of PhpStorm:
PhpStorm discontinued using SVNKit with svn >= 1.8 so it will not ask for your SSH credentials anymore as it did before but will depend on proper command-line clients to be available and configured.
Now, this works for me:
Load your private key with Putty pageant (double click on key and enter your password)
Add a SVN_SSH Windows environment variable with content: C:\\Program Files\\TortoiseSVN\\bin\\TortoisePlink.exe (Adjust to your path, but keep the double backslashes!)
Now, from the command line (restart command line window before trying)
echo %SVN_SSH% needs to give you the plink.exe path and you should be able to do a svn up on command line without entering your password.
Restart your PhpStorm and SVN should work.

I've spent quite time on the issue, yet still couldn't find the exact problem. One issue is about the 1.8 format of SVN with PhpStorm, it cannot handle the svn+ssh authentication. It is possible to use TortoiseSVN 1.8 but always sticking the 1.7 format in PhpStorm.
My final solution was to install TortoiseSVN 1.7, so that I can use it from the Windows menu as well and no formatting issues happen. Another setting necessary for me was unchecking the option under Version Control > Subversion.
[] Use command line client: svn
As the ssh executable, I use:
C:\Program Files (x86)\PuTTY\plink.exe

Related

Run batch scripts on a remote server (windows) from jenkins

I've got a continuous integration server (Jenkins ) which builds my code (checks for compilation errors) and runs tests and then deploys the files to a remote server (not a war file, but the actual file structure) I do this with a Jenkins plugin which allows me to transfer files via samba, it does this nightly.
Now, what I need to do is run an ant command on the remote server. And after that I need to start the application server on the remote server, the application server is started by running a .bat file from the command line.
I'm pretty clueless how to accomplish this, I know Jenkins is capable of running batch commands, but how do I make them run in the context of the server and not the context of the build server?
If Jenkins on Windows, remote on *nix, use plink.exe (which is essentially command line PuTTy)
If Jenkins on Windows, remote on Window, use psexec.exe
If Jenkins on *nix, remote on *nix, use ssh
If Jenkins on *nix, remote on Windows, (update 2015-01) Ansible http://docs.ansible.com/intro_windows.html has support for calling Windows commands, eg powershell, from a unix/linux machine, https://github.com/ansible/ansible-examples/blob/master/windows/run-powershell.yml
Tell me what OSes are involved (both on Jenkins and remote), and I will flash this out further.
Edit:
The download page for psexec.exe lists all command line options. You will want something along the lines of:
psexec \\remotecomputername -u remoteusername -p remotepassword cmd /c <your commands here>
Replace <your commands here> with actual commands as you would execute them from command prompt.
Note that psexec first needs to install a service, and required elevated command prompt/admin remote credentials to do so.
Also, you need to run psexec -accepteula once to accept the EULA prompt.
Following Slav's answer above, here is a simpler solution for Jenkins (*nix) to remote (windows):
Install an SSH server on your remote windows (MobaSSH home edition worked well for me)
Make sure your Jenkins user, on your Jenkins machine, has the required certification to open an SSH connection with your remote (you can simply open a terminal and ssh to your remote once, then accept the certification. Make sure it is saved for the Jenkins user).
You can now add an execute shell build phase in your Jenkins job which can SSH to your remote windows machine.
Notes :
The established connection might require some additional work - you might have to set windows environment variables or map network drivers in order for your executed commands or batch files to work properly on your windows machines.
If you wish to run GUI related operations this solution might not be relevant (Following my work on running automation tests which require GUI manipulation).
Using Jenkins SSH plugin is an issue, as seen here.
1、i install (MobaSSH home ) on my remote windows server .
2、and install jenkins ssh plugin
3、edit shell eg: go build project
4、it seems something wrong ,
" go: creating work dir: CreateFile C:\WINDOWS\system32\bsh\tmp: The system cannot find the path specified."
I ended up going with a different approach after trying out psexec.exe for a while.
Psexec.exe and copying files over the network was a bit slow and unstable, especially since the domain I work on has a policy of changing password every months (which broke the build).
In the end I went with the master/slave approach, which is faster and more stable. Since I don't have to use psexec.exe and don't have to copy files over the network.

How to download a file from my server using SSH (using PuTTY on Windows)

When I try downloading a file from my server onto my computer, it actually downloads the file onto the server.
(Note I am already SSH'd into my server before typing this command. I've watched tutorials on YouTube and people are using their terminal without SSHing into any particular server, however I don't think I can do this with PuTTY on Windows?)
scp -r -P2222 kwazy#mywebsite.example:/home2/kwazy/www/utrecht-connected.nl ~/Desktop/
The problem is that I am specifying the location to download the file as only ~/Desktop/
This creates a folder called Desktop in my server, instead of copying the files onto my local desktop.
I am able to use this command on Linux.
I have successfully download the folder onto my desktop:
I still need insight onto how I can do this on a Windows machine.
There's no way to initiate a file transfer back to/from local Windows from a SSH session opened in PuTTY window.
Though PuTTY supports connection-sharing.
While you still need to run a compatible file transfer client (pscp or psftp), no new login is required, it automatically (if enabled) makes use of an existing PuTTY session.
To enable the sharing see:
Sharing an SSH connection between PuTTY tools.
Even without connection-sharing, you can still use the psftp or pscp from Windows command line.
See How to use PSCP to copy file from Unix machine to Windows machine ...?
Note that the scp is OpenSSH program. It's primarily *nix program, but you can run it via Windows Subsystem for Linux or get a Windows build from Win32-OpenSSH (it is already built-in in the recent versions of Windows 10 and in Windows 11).
If you really want to download the files to a local desktop, you have to specify a target path as %USERPROFILE%\Desktop (what typically resolves to a path like C:\Users\username\Desktop).
Alternative way is to use WinSCP, a GUI SFTP/SCP client. While you browse the remote site, you can anytime open SSH terminal to the same site using Open in PuTTY command.
See Opening Session in PuTTY.
With an additional setup, you can even make PuTTY automatically navigate to the same directory you are browsing with WinSCP.
See Opening PuTTY in the same directory.
(I'm the author of WinSCP)
try this scp -r -P2222 kwazy#mywebsite.example:/home2/kwazy/www/utrecht-connected.nl /Desktop
Another easier option if you're going to be pulling files left and right is to just use an SFTP client like WinSCP. Then you're not typing out 100 characters every time you want to pull something, just drag and drop.
Just noticed /Desktop probably isn't where you're looking to download the file to. Should be something like C:\Users\you\Desktop
OpenSSH has been added to Windows as of autumn 2018, and is included in Windows 10 and Windows Server 2019.
So you can use it in command prompt or power shell like bellow.
C:\Users\Parsa>scp parsa#192.168.100.11:/etc/cassandra/cassandra.yaml F:\Temporary
parsa#192.168.100.11's password:
cassandra.yaml 100% 66KB 71.3KB/s 00:00
C:\Users\Parsa>
(I know this question is pretty old now but this can be helpful for newcomers to this question)
if you install git with git bash, you get SCP available on windows.
You can use WinSCP : https://winscp.net/eng/download.php
Or MobaXterm : https://mobaxterm.mobatek.net/download.html
It feels like FTP client. Also I don't remember setting up anything on my machine for this. It just fresh install and install SSH server (IDK if it matters though).
For MobaXterm :
If your server have a http service you can compress your directory and download the compressed file.
Compress:
tar -zcvf archive-name.tar.gz -C directory-name .
Download throught your browser:
http://the-server-ip/archive-name.tar.gz
If you don't have direct access to the server ip, do a ssh tunnel throught putty, and forward the 80 port in some local port, and you can download the file.
You can use the WinSPC program. Its access to any server is pretty easy. The program gives its guide too. I hope it's helpfull.
If you need something with GUI you can use FileZilla. it support SFTP.
It's perfectly working with ssh and you can even edit files and it will automatically upload the changes.

How do I make my SVN repository work across both windows & ubuntu on a dual boot PC?

I have dual boot windows+ ubuntu PC. I created subversion repository for my netbeans project within windows 8 & used that for years but now I have started to use ubuntu as well on the same PC. But When I open my netbeans project in ubuntu, the project can't probably find my subversion repository(created by windows) & gives the following messages, I can access the repository however on , disk through ubuntu. How do I rectify this to enable proper communication between my project & repository while using ubuntu.
svn: E180001: Unable to open an ra_local session to URL
svn: E180001: Unable to open repository 'file:///E:/DATA/PX10_DATA/SubversionRepository/PApp/src/main/webapp/js/essentials.js'
svn: E180001: Unable to open repository 'file:///E:/DATA/PX10_DATA/SubversionRepository/PApp/src/main/webapp/js/essentials.js'
svn: E180001: Unable to open an ra_local session to URL
svn: E180001: Unable to open repository 'file:///E:/DATA/PX10_DATA/SubversionRepository/PApp/src/main/webapp/js/essentials.js'
svn: E180001: Unable to open repository 'file:///E:/DATA/PX10_DATA/SubversionRepository/PApp/src/main/webapp/js/essentials.js'
Your problem is that you're running the repo as a file-based client, not as a proper server.
Run svnserve or mod_subversion inside apache and give that access to your repository files. Then your client connect to the server to perform all svn operations.
Obviously, you'll need to run both the Windows and the Linux version of svnserve to make this happen using the same repo - and might give you issues with line endings (ie the Ubuntu version of svnserve will not be able to read files created by the Windows version) but I think you might be able to jiggle settings and run the linux version under Windows which might be able to handle the linux-line endings correctly. Maybe.
This will solve your problem with the url - that looks like a Windows path and not a Linux one (ie the E: drive letter suggests this). You will not be able to re-wire this path (that is stored in the .svn directory DB for your working copy) safely.
However, the best answer is to run a little linux VM that contains your repo and a svn server, and mount it on both Windows and Ubuntu.

How do you edit files over SSH?

I program with eclipse and sometimes use GUI text editors like SciTE or vim. However, I'm at a point in a project that requires me to edit files over a ssh connection in a 80 column SSH window.
Since I have to (* shiver*) sudo vim before I can open the file I'm not sure how to open the file in an editor outside the terminal (that would allow me to see the text wider than 80 columns). If the command line was larger then I guess using straight vim wouldn't be a problem.
I'm at a loss of how to deal with this situation and how I could turn this nightmare into a manageable coding environment.
Maybe you should simply mount the remote filesystem to your local machine and then use whatever editor you like. If running a Debian derivative, install sshfs
sudo apt-get install sshfs
and then mount the remote filesystem ( issue on your local machine )
mkdir ~/remote_code
sshfs $USER#remote.example.com:/home/$USER/code ~/remote_code
Once this is done you can access the code in ~/remote_code w/ any of your GUI tools and without the bandwidth overhead of using ssh -X (however you still need a good connection w/ a low ping time).
PS: When using ssh I can make the terminal as wide as it fits my screen and then use its full width, so I fear I don't completely understand your issue.
WinSCP is a SSH client ftp-like. The default editor is primitive but can be change.
There are various options.
You can make the terminal larger. ;)
If you have a graphical environment installed on the machine you are ssh'ing into, you can login with ssh -X (or xdeep-putty if you are on Windows) to enable window forwarding. You can then run your favourite editor on the remote machine, whose graphical output is forwarded.
Finally, you can mount the ssh connection into your file system, using for example fuse (similar options might exist for non-linux operating systems). That allows you to access any file on the remote machine as if it were in your filesystem, with your favourite editor, locally.
I'm not 100% sure if this works for files owned by root, but if your desktop is KDE & your remote system is Linux (or pretty much any form of *nix), you can get konqueror to access the remote machine using the "fish://" protocol. From there you can open the file from konqueror using kate, or your preferred editor, and konqueror will take care of copying the file to your local machine and copying it back when you save.
Failing which the X11 forward is a good option, but X11 over ssh to remote sites can be slow. "ssh -X -C" compresses the data stream and can give better performance.
Notepad ++ has a plugin for editing files remotely over ssh. I've used it before, but I definitely prefer Kate on KDE using the fish protocol.
http://www.inmotionhosting.com/support/website/ftp-client-setup/connect-ftp-notepad-plus
Forward your X11 session to your terminal.
http://dragonwall.net/xdeep-putty.html
This probably belongs on superuser.com.
You might try the Komodo editor. It has a feature to load a 'remote file' over ssh. It's really convenient.
Emacs and ange-ftp.
If you're on Ubuntu, go to Nautilus (file explorer), connect to server (adding sftp:// to the hostname), then voila! You can easily launch gedit to edit your files now.
On Windows, you can use MobaXterm ( http://mobaxterm.mobatek.net ): it has a built-in SSH client with a very useful "SFTP browser".
As soon as you connect to your remote server using SSH, you will see your remote files displayed in this graphical SFTP browser. Just double-click on your files and you will be able to edit them directly on your remote server through SFTP.
I use Cyberduck and Sublime Text 2
FileZilla did the trick for me. Notepad++ can be used with it which is awesome.
If you using windows, try Editplus. It's not free but allows you to open files directly over scp. Custom syntax files are coming really handy, too.
Recent versions of ultraedit do exactly what the OP is asking for elegantly (IDM software, v10 and up support SSH iirc). I do most of my coding remotely like that, been using it for years, works great with no intermediate files etc. Obviously it also does FTP etc too if you're so inclined.
I actually found this page whilst looking for a linux equivalent of ultraedit..
If you are more GUI-oriented and use one of the more newbie-friendly Linux distros like Ubuntu or Mint, this is another option and does not require any more installations.
You should have nemo as your default file manager. It may not be called "Nemo" on the menu, so go under Help > About of your file manager ("Files" app) to see.
In nemo, go to File > Connect to server, enter your remote machine's details (SSH's default port is 22), and then open the files just like any file on your local machine, with whatever editor you prefer. You can even close Nemo and continue working in your editor.
From the address bar, it seems to be using the sftp protcol.
Just be aware that if your remote host has an inactivity timeout for the SSH connection, this will also prevent you from saving changes in the editor after the timeout has dropped the connection...
Since sshfs is not supported in WSL at the moment, the tool that worked for me is sshfs-win.
Installation Steps
Go here and click "download winfsp"
Install it
Go here and download the installer
Install it
Open windows explorer and right-click "This PC" > "Map Network Drive..."
Select a drive letter (B:), type in "\\sshfs\debian#10.13.100.36" and click Finish
Boom, done. Now you can have a B: drive on your computer and just do whatever with those files. Open them with VSCode, delete them, whatever you like
If you work in IntelliJ IDEA, you can use Friendly Terminal plugin instead of the native terminal. It allows to open and edit remote files in IntelliJ IDEA editor. Video

Cloning a repository results in a timeout

I upgraded my OS to Windows 7 and installed mercurial, but I can't seem to be able to clone any remote repository. Windows Firewall is disabled and I don't have a third-party firewall. I even tried to launch the command prompt as administrator. No matter what I do, I always get this Operation timed out error. Any ideas?
c:\Users\Alfred>hg clone http://bitbucket.org/jespern/django-piston/ hgrepo
abort: error: Operation timed out
Hrm, what does the output look like when you include --debug and --verbose?
Also, what happens if you clone over ssh using this command line?
hg clone ssh://hg#bitbucket.org/jespern/django-piston/ hgrepo
It works fine when I clone it just now. I guess Bitbucket simply had a small problem. In such a case, the best reaction is to log onto the #bitbucket IRC channel on irc.freenode.net -- StackOverflow is not a very good support forum, especially for transient problems like this.

Resources