21

I have been trying to deploy my app into the Fortrabbit servers using the command line. I'm using windows. Here is what I tried :

C:\projects\riwaya>git remote add fort git@git2.eu1.frbit.com:riwaya.git
C:\projects\riwaya>git remote fort
C:\projects\riwaya>ssh u-riwaya@ssh2.eu1.frbit.com
'ssh' is not recognized as an internal or external command, operable     program or batch file.

I have watched This Laracast Video and did the same as Jeffrey but it doesn't work ...

Can somebody help ?

edi9999
  • 19,701
  • 13
  • 88
  • 127
Daniel Chikaka
  • 1,432
  • 4
  • 17
  • 28
  • You can ask the question on the `Laracast Forum` mentioning this video tutorial. maybe `Jeff` will help too. – The Alpha Jun 11 '14 at 09:04
  • You could install ssh with **chocolatey** by just doing `choco search ssh` then install the one you prefer. I'm not sure if this is outside the topic but for windows a package manager like `choco` can help you a lot with dev tools (like ssh). – ArchNoob Aug 18 '16 at 14:46
  • Actually use putty on windows. It's windows native ssh agent. – Qwerty May 04 '17 at 14:43
  • check the environment path (git-base is set or not ) – sivaprakash Jun 25 '17 at 08:08

5 Answers5

12

Actually you have 2 problems here: First is that you don't have ssh installed, second is that you don't know how to deploy

Install SSH

It seems that ssh is not installed on your computer.

You can install openssh from here : http://openssh.en.softonic.com/download

Generate your key

Than you will have to geneate your ssh-key. There's a good tutorial about this here:

https://help.github.com/articles/generating-ssh-keys#platform-windows

Deploy

To deploy, you just have to push your code over git. Something like this:

git push fort master

If you get permission denied, be sure that you have put your public_key in the dashboard in the git tab.

SSH

The ssh command gives you access to your remote node. You should have received a password by email and now that you have ssh installed, you should be asked for a password when trying to connect. just input that password. If you want to use your private ssh key to connect to your server rather then typing that password, you can follow this : http://fortrabbit.com/docs/how-to/ssh-sftp/enable-public-key-authentication

edi9999
  • 19,701
  • 13
  • 88
  • 127
8

For Windows, first install the git base from here: https://git-scm.com/downloads

Next, set the environment variable:

  1. Press Windows+R and type sysdm.cpl
  2. Select advance -> Environment variable
  3. Select path-> edit the path and paste the below line:
C:\Program Files\Git\git-bash.exe

To test it, open the command window: press Windows+R, type cmd and then type ssh.

GM1
  • 380
  • 3
  • 14
sivaprakash
  • 528
  • 6
  • 15
4

First of all Go to browser and install openssh here: https://github.com/PowerShell/Win32-OpenSSH/releases

Next step, extract rar file into folder and then copy and paste it in your drive. after that run command: ssh it should work.

Next step is right click on shh in openssh folder and go to properties. Copy the path and paste it in system variables in edit environment variables. It will work fine.

2

TLDR, add this to settings.json

"terminal.integrated.env.windows":
{
        "PATH": "C:/Windows/System32/OpenSSH",
},

Just found a case when the integrated terminal hasn't recognized 'ssh' as command, but you tried 'ssh' that was working on external terminals like CMD, git-bash.

That means you didn't add PATH variable to your integrated terminal.

MichaelMao
  • 2,596
  • 2
  • 23
  • 54
Kelvin
  • 51
  • 3
0

If anyone looking for solution even now, here is how I did it for my Windows 10 machine.

  1. Start > type 'Manage Optional Features'
  2. Add Feature [+]
  3. Look for OpenSSH client & select & install
  4. After successful installation, open (close if already opened) powershell or command prompt and run ssh!
Kunapareddy
  • 45
  • 1
  • 8
  • this is an easy and clean solution, but the download always fails for me. Hope it works for someone else – red_wolf Jan 18 '23 at 00:48