The most important: You must have shell access!
![]()
Clone git repository from a server using ssh key. Ask Question Asked 5 years, 3 months ago. I generated a couple of private and public keys on cpanel and put the public one under.ssh/idarsa.pub. Otherwise, SSH can't generate the secrets necessary to establish the secure authentication. Share improve this answer. Edited Aug 28 '14 at. 7) Enter the key passphrase and confirm it. 8) Click the button ‘Save private key’ to save the private key. 9) Click the button ‘Save public key’ to save the public key. 10) Make sure to copy the text in the field ‘Public key for pasting into openSSH authorized keys file. Generate an SSH Key on Windows. Windows environments do not have a standard default unix shell. External shell programs will need to be installed for to have a complete keygen experience. The most straight forward option is to utilize Git Bash. Once Git Bash is installed the same steps for Linux and Mac can be followed within the Git Bash shell.
![]()
This gist assumes:
you should be able to do the same with Java, Perl, RoR, JSP etc. however you'll need to recreate the (rather simple) PHP script
Here we add the deployment script and push it to the origin, the deployment script runs git commands to PULL from the origin thus updating your server
Grab a deployment script for your site
See deploy.php
Add, commit and push this to github (Optional)
Here we install and setup git on the server, we also create an SSH key so the server can talk to the origin without using passwords etc
cPanel should have installed git allredy.
To check run in shell account command
Generate a deploy key for apache user
Here we add the SSH key to the origin to allow your server to talk without passwords. In the case of GitHub we also setup a post-receive hook which will automatically call the deploy URL thus triggering a PULL request from the server to the origin
Returns a KeyPairGenerator object that generates public/privatekey pairs for the specified algorithm.A new KeyPairGenerator object encapsulating theKeyPairGeneratorSpi implementation from the specified Providerobject is returned. Note that the specified Provider objectdoes not have to be registered in the provider list. Bouncycastle openpgp.
Generate Key In Cpanel For GithubGitHub instructionsAdd the SSH key to your user
Cpanel Git Version ControlSet up service hook
Bitbucket instructionsAdd the SSH key to your account
Set up service hook
First Pull from origin
Now you're ready to go :-)
Some notes
SourcesGenerate Key In Cpanel For Gita
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |