使用的gogs不能使用ssh的方式連線

2021-07-10 15:20:09 字數 511 閱讀 3317

這是乙個備份,起因是由於我現在使用的gogs不能使用ssh的方式連線,主要是不方便,所以目前我是使用了http的方式。

看了這篇文章後對我有啟發,但是我沒有使用,所以只是先做個備份。

原文在:

一直想實現指定git訪問的私鑰,網上資料給出來的都是通過ssh_config來實現,這種方法很繁瑣,另外想實現git webhook部署時,使用這種方法也比較不靈活。  

切入正題

建立git_ssh檔案,內容如下

#!/bin/bash

ssh -i $ssh_key_file $1 $2

然後增加執行許可權

chmod 755 git_ssh

然後就可以通過如下命令指定git訪問時使用的ssh私鑰

ssh_key_file=/root/git/id_rsa git_ssh=/root/git/git_ssh git clone git@***

另外乙個解決方法:

pdfcrop不能使用

最近,用到了pdfcrop,用來去除pdf中空白的邊。但是使用pdfcrop margins 0 pdf 後,給出了錯誤 error pdfcrop cannot call ghostscript 但是我已經安裝了ctex,裡面已經包含ghostscript,所以就不知道什麼錯誤。在網上針對這個問題...

CGRect CGFloat 不能使用

筆者還在照著別人 敲東西的階段 汗顏哪 言歸正傳,今天敲 的時候發現只要是繼承nsobject的類 都不能使用cgrect cgfloat 會報 unknown type name cgrect did you mean rect or unknown type name cgfloat 糾結了一下...

oracle 不能使用for update

select from table name for update 造成oracle資料庫卡死 1 首先查詢出問題表的session id select session id from v locked object l join dba objects o on l.object id o.obj...