MerDoLive / AdminPanel

MIT License
0 stars 0 forks source link

svn set up #24

Closed merzido closed 6 years ago

merzido commented 6 years ago
  1. Create IAM user

  2. Attach Policies sshUserKey awsCodeCommit

  3. Create ssh key in OSX $ ssh-keygen

    Generating public/private rsa key pair. Enter file in which to save the key (/home/user-name/.ssh/id_rsa): Type /home/your-user-name/.ssh/ and a file name here, for example /home/your-user-name/.ssh/codecommit_rsa

    Enter passphrase (empty for no passphrase): <Type a passphrase, and then press Enter> Enter same passphrase again: <Type the passphrase again, and then press Enter>

    Your identification has been saved in /home/user-name/.ssh/codecommit_rsa. Your public key has been saved in /home/user-name/.ssh/codecommit_rsa.pub. The key fingerprint is: 45:63:d5:99:0e:99:73:50:5e:d4:b3:2d:86:4a:2c:14 user-name@client-name The key's randomart image is: +--[ RSA 2048]----+ E.+.o*.++ .o .=.=o. . .. *. + ..o . +.. So . . . .

    +-----------------+

  4. View and copy public key content cat ~/.ssh/codecommit_rsa.pub ssh-rsa EXAMPLE-AfICCQD6m7oRw0uXOjANBgkqhkiG9w0BAQUFADCBiDELMAkGA1UEBhMCVVMxCzAJB gNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb2 5zb2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAdBgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wHhc NMTEwNDI1MjA0NTIxWhcNMTIwNDI0MjA0NTIxWjCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAw DgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDAS=EXAMPLE user-name@ip-192-0-2-137

  5. Add/upload SSH public key content for AWS CodeCommit in IAM permission

  6. Copy or save the information in SSH Key ID (for example, APKAEIBAERJR2EXAMPLE).

  7. Configure config file in ~/.ssh Host codecommit Hostname git-codecommit.us-east-1.amazonaws.com User APKAEIBAERJR2EXAMPLE IdentityFile ~/.ssh/codecommit_rsa

  8. Change config file permisssion chmod 600 config

  9. Test ssh connection ssh -v codecommit OpenSSH_6.9p1, LibreSSL 2.1.8 debug1: Reading configuration data /Users/rudimanto/.ssh/config debug1: /Users/rudimanto/.ssh/config line 1: Applying options for codecommit debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 21: Applying options for * debug1: Connecting to git-codecommit.us-east-1.amazonaws.com port 22. debug1: Connection established. debug1: identity file /Users/rudimanto/.ssh/aws_codecommit_rsa type 1 debug1: key_load_public: No such file or directory debug1: identity file /Users/rudimanto/.ssh/aws_codecommit_rsa-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_6.9 debug1: Remote protocol version 2.0, remote software version AWSCodeCommit OCB debug1: no match: AWSCodeCommit NiAwNz debug1: Authenticating to git-codecommit.us-east-1.amazonaws.com:22 as 'SSH ID' debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client aes128-ctr hmac-sha2-256 none debug1: kex: client->server aes128-ctr hmac-sha2-256 none debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<8192<8192) sent debug1: got SSH2_MSG_KEX_DH_GEX_GROUP debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: got SSH2_MSG_KEX_DH_GEX_REPLY debug1: Server host key: ssh-rsa SHA256:ABCY debug1: Host 'git-codecommit.us-east-1.amazonaws.com' is known and matches the RSA host key. debug1: Found key in /Users/rudimanto/.ssh/known_hosts:12 debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Offering RSA public key: /Users/rudimanto/.ssh/aws_codecommit_rsa debug1: Server accepts key: pkalg ssh-rsa blen 279 debug1: Authentication succeeded (publickey). Authenticated to git-codecommit.us-east-1.amazonaws.com ([IP]:22). debug1: channel 0: new [client-session] debug1: Entering interactive session. debug1: Sending environment. debug1: Sending env LC_CTYPE = UTF-8 You have successfully authenticated over SSH. You can use Git to interact with AWS CodeCommit. Interactive shells are not supported.debug1: channel 0: free: client-session, nchannels 1 Connection to git-codecommit.us-east-1.amazonaws.com closed by remote host. Connection to git-codecommit.us-east-1.amazonaws.com closed. Transferred: sent 3880, received 2136 bytes, in 1.0 seconds Bytes per second: sent 3699.8, received 2036.8 debug1: Exit status -1

  10. Make ssh connect ssh codecommit You have successfully authenticated over SSH. You can use Git to interact with AWS CodeCommit. Interactive shells are not supported.Connection to git-codecommit.us-east-1.amazonaws.com closed by remote host. Connection to git-codecommit.us-east-1.amazonaws.com closed.

  11. Start Git clone git clone ssh://SSHKeyID@git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo my-demo-repo