Config Github/Gitlab Problem&solution

Config Github/Gitlab Problem&solution

1.(1)problem

cdlab@cdlab-MS-7A95:~$ ssh -T [email protected]
Warning: Permanently added the RSA host key for IP address '192.30.253.122' to the list of known hosts.
[email protected]: Permission denied (publickey).

1.(2)solution

cdlab@cdlab-MS-7A95:~$ eval "$(ssh-agent -s)"
cdlab@cdlab-MS-7A95:~$ ssh-add /home/cdlab/.ssh/githubkey
cdlab@cdlab-MS-7A95:~$ ssh-add -l -E md5

2.(1)problem

cdlab@cdlab-MS-7A95:~/.ssh$ ssh -T [email protected]
ssh: connect to host github.com port 22: Connection timed out

cdlab@cdlab-MS-7A95:~/.ssh$ ssh -T [email protected]
ssh: connect to host gitlab.com port 22: Connection timed out

2.(2)solution

#Github solution
create file ~/.ssh/config (On windows probably %USERPROFILE%\.ssh\config)
Paste the following code in config file:
	Host github.com
	User git
	Hostname ssh.github.com
    
#Gitlab solution
Paste the following code in config file:
	Host gitlab.com
	Hostname altssh.gitlab.com
	User git
	Preferredauthentications publickey
	IdentityFile ~/.ssh/gitlabkey
	Port 443
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章