Git - SSH login

SSH login

  • Into the current user's home directory
    $ cd ~

  • Remove the .ssh directory
    $ rm -rvf .ssh

  • Run command to generate a key .ssh directory
    $ SSH-keygen -t RSA -C [email protected]
    [Note: this parameter is herein -C uppercase C]

Here Insert Picture Description

  • View a list of files into the directory .ssh
    $ cd .ssh
    $ LS -LF

  • View the contents of the file id_rsa.pub
    $ cat id_rsa.pub
    Here Insert Picture Description

  • Id_rsa.pub Copy the contents of the file, log on GitHub, click the user's avatar -> Settings-> SSH and GPG keys

  • New SSH Key

  • Enter the key information copied
    Here Insert Picture Description

  • Back to the Git bash create an alias address remote
    git remote add [email protected]: atguigu2018ybuq / huashan.git

  • Push files for testing

Published 584 original articles · won praise 1815 · Views 220,000 +

Guess you like

Origin blog.csdn.net/cold___play/article/details/103738777