error while cloning a project in moovweb from commandline - moovweb

I am new to moovweb. Using gitbash to login to moov server . After logging in I try to clone a project created successfully at moov web site from gitbash(as admin). I get the below error
$git clone moov#git.moovweb.com:bharath2k5/wikipedia.git
ssh:connect to host git.moovweb.com port 443: Bad file number
fatal:could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
Also this is my .ssh/config.
Host git.moovweb.com
IdentityFile ~/.ssh/id_rsa
PreferredAuthentications publickey
Port 443
Thanks for your help.

It looks like your computer failed to connect to the moovweb git server (git.moovweb.com) so it didn't even get to the authentication step. I noticed you have a rule in your ssh config to use port 443 instead of 22. Does your network block port 22 access? It's possible that even with the configuration, git is still using port 22. You can check by running the following command:
Best way to check is to run the following command in git bash:
$ ssh -vv moov#git.moovweb.com
That should give you a lot of information, including which port ssh is trying to use.
Anyways, you can force git to use port 443 on a particular project by changing the URI used to clone the project. Try the following and see if it works:
$ git clone ssh://moov#git.moovweb.com:443/bharath2k5/wikipedia.git
If that works, it seems that the Port configuration in .ssh/config doesn't seem to apply to git operations.

Related

Failed to connect to github.com port 443: Time out

When try to clone a project using the git clone command I got this following error message.
Failed to connect to github.com port 443: Time out
DDoS attack check this link https://status.github.com/
The connectivity problems have been identified as a DDoS attack. We're working to mitigate now.
Make sure that you have used
$ git remote add origin git#github.com:**yourname**/learngit.git
to connect your local repository to github.
If you find the following error:
fatal: remote origin already exists.
Then write the following statement in your git bash.
$ git remote rm origin
then write again to re-connect your repository to GitHub.
$ git remote add origin git#github.com:**yourname**/learngit.git
If the above steps can not help you, there must be some ssh errors I think.

Private Github Repositories with Envoy

Anybody has any problems deploying with Laravel's envoy when using private Github repos?
When manually cloning my repo from the production server, the ssh key seems to be accessible but when using Envoy, I always get a "Permission denied (publickey) error.
Thanks
It is probably because the ssh key on your remote server requires a password.
If you change the Envoy.blade.php to perform some other task you should be able to establish whether you are connecting to your remote correctly.
#servers(['web' => 'user#domain.com'])
#task('deploy')
cd /path/to/site
git status
#endtask
Should return something like:
[user#domain.com]: On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
If you are connecting using a Mac or Linux you probably don't have to enter your password because your terminal is using ssh-agent which silently handles your authentication.
Wikipedia article on ssh-agent
When connecting over ssh, ssh-agent isn't running and the script is being prompted for a password which is where it is failing.
To get around this you could to generate a new key on the remote machine that doesn't use a password.
If you want to restrict the ssh key to a single repository on GitHub have a look at deploy keys
You need to pass the -A (as per the man page it - Enables forwarding of the authentication agent connection. This can also be specified on a per-host basis in a configuration file) in you ssh string.
You will also need add your ssh key for agent forwarding (on the machine which can access the git remote which I assume be your localhost)
ssh-add -K ~/.ssh/your_private_key
Something like this
#servers(['web' => '-A user#domain.com'])
#task('deploy')
cd /path/to/site
git status
#endtask
Git remote commands should now work.

How to Clone a Git repository in Eclipse with non standard port on osx

My context:
My Git repository is on a Ubuntu Server where I changed the ssh port
On my client side (OS X) the syntax ssh host:port doesn't work
Using shell, the solution is simple: ssh host -p port
But, I'm using Eclipse and I need to clone my project from eclipse
When I used the standard port (22), the eclipse wizzard 'clone a git repository' was working fine but since I have changed the port, The wizzard failed:
I fill the following fields:
Host
Repository
Path
Protocol (ssh)
Port
user
password
I see in Eclipse window that URI is created with the syntax:
ssh://user#host:port/repository
so, as this syntax doesn't work in shell, I suppose it is the reason
I try this workaround:
Create a host in /.ssh/config
with an alias and my new port
And use the alias in the host field of Eclipse
It doesn't work and it seems Eclipse does not take in account my config file
After many google researches, I finally try asking a new question here
Many thanks for your help
Having just spent 3 days beating my head on the wall about this, I'm gonna answer you even though I'm a few years too late to help probably.
I noticed on the firewall of my git server that Eclipse was hitting port 22 no matter what port I specified in the dialog. After confirming I could manually connect with
ssh -i ~/.ssh/git-privkey -p 3215 git#git.example.com
And you should get connected and welcomed, then disconnected.
I set up my ~/.ssh/config file like so:
Host git.example.com
Hostname git.example.com
Port 3215
User git
IdentityFile ~/.ssh/git-privkey
It is important to have the Host value match the host that Eclipse will connect to, which will also match the Hostname value. If you don't do this, the host-specific configuration won't take effect.
Now test by connecting with just
ssh git.example.com
And you should get connected and welcomed, then disconnected.
Now, in Eclipse, simply copy/paste the SSH URI and leave the default port 22 set. Username should come in from the URI (default is git).

Is it possible to start jenkins through proxychains

I have code repository on GitHub and CI server (Ubuntu) with Jenkins behind firewall.
So I set proxy settings to jenkins and it works fine (e.g. i can see the availvable plugins).
And I configured proxy settings in .gitconfig.
Also i have id_rsa in jenkins home/.ssh directory.
But jenkins can't perform git clone during job execution because of an error:
ssh: connect to host github.com port 22: Connection timed out
Jenkins user successfully performs proxychains git clone operation in terminal.
Is it possible to force jenkins works through proxychains? Or could anybody advice me some alternatives?
I have solved my problem wih this:
http://blog.paulbetts.org/index.php/2008/04/08/getting-ssh-to-connect-through-a-socks-proxy/
I have solved similar problem using STDIO proxy tunnel.
update ~/.ssh/config:
Host github.com
HostName github.com
User git
ProxyCommand gitproxy %h %p
create ~/bin/gitproxy script with this content:
#!/bin/sh
exec socat STDIO PROXY:proxy.com:$1:$2,proxyport=8080,proxyauth=user:password

Capistrano Net::SSH::Authentification::AgentError

I'm trying to set up capistrano for pushing my project, using git as VCS.
I'm running capistrano on a win7 machine, and want to push on my ubuntu 64bit EC2, here is what capistrano says: http://pastebin.com/FRyzYFbE
My local SSH Client is Putty, and works pretty fine, for my deploy.rb i've set something like: http://pastebin.com/UubfdDYm
Does anyone know what's going on there?
I don't have Win7, but I can tell you what worked for me on winXP. I added an SSH config file to %USER_HOME%/.ssh/config
The contents of that file look like this:
Host dev
User ubuntu
Hostname example.com
IdentityFile path/relative/to/user_home_ssh/mykey.ppk
The Host line can be the actual host or a nickname that you will use. Here, I used a short nickname. This should match the IP or hostname you use in your capistrano config.
The User should be the user you set in your capistrano config (ubunto in your case).
The Hostname is the real hostname or IP of the server you will access. The IdentityFile is a path relative to your USER_HOME/.ssh directory.
Ok, I found out that, because i have Git installed, the home directory for my ssh config is C:\Program Files\Git\.ssh
I had to fi several things there, and when it first works to connect via ssh in the command line (thanks to Git i have an SSH client installed), the connection was successfull.
There is still a bug, cause Capistrano can't do a local git command due to SSH key error, if i do the same command in the CLI, it works perfeclty. But I think I will stop using capistrano and use something easier, a remot git pull && /build.sh should do the trick.