首页 源码 正文

SSH仿知乎源码(ssh网站源码)

2024-07-25 08:07:51 55 0
admin

在写这篇文章之前SSH仿知乎源码,我一直使用用户名和密码方式进行各种操作SSH仿知乎源码,因为比较方便省心SSH仿知乎源码,但是在使用的过程中SSH仿知乎源码,偶尔会出现异常问题,导致Git下载失败,所以建议大家都使用ssh key方式更新代码。

在Jenkins机器上生成ssh key执行生成命令ssh-keygen -t rsa查看秘钥,并拷贝公钥内容

在上一步生成的过程中会显示秘钥存储位置

SSH仿知乎源码

因为我们采用的是docker部署Jenkins,所以默认登录用户是jenkins,拷贝公钥内容cat /var/jenkins_home/.ssh/id_rsa.pub

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCw2pNxQiO2O8MEJoetY5EnPUeP1uXKSThgD5ESjcGvYoQayh77DnCqqlYPNlcU2VkgTGQNECCvE2HixS9eF6ScKiu005MkAuE0//tiBLWe9tqmD2ms8QTEFpSbgjPzfLNs2XjY3ChLFc5t6ib3yDudwQAyw57+Bxj7I94WpOngn0L+ObI0LDwKxPI0UIQSZyuqBrKOSIA6eG3L9xQ7hFF5/r6phDj9Sls7j7L4ZnNynX65zJYsrYmMdcbQT6B39YCSQmYvf6iC4Xqa+iU4NMhgUm5d3+J84Kxs3FWC/Aq4XsBeLa/+9fSZqN0uJCXeQh3l1eGgWwxHQLsL7tZPtNMZ jenkins@fa2f55e38fca添加公钥到gitee上SSH仿知乎源码

在Jenkins中新增ssh key凭据

“系统管理”->“Manage Credentials”,添加凭据

SSH仿知乎源码

将第一步中生成的私钥内容拷贝cat /var/jenkins_home/.ssh/id_rsa

-----BEGIN OPENSSH PRIVATE KEY-----b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABFwAAAAdzc2gtcnNhAAAAAwEAAQAAAQEAsNqTcUIjtjvDBCaHrWORJz1Hj9blykk4YA+REo3Br2KEGsoe+w5wqqpWDzZXFNlZIExkDRAgrxNh4sUvXheknCortNOTJALhNP/7YgS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TBv6OyhAdXtSsrnTt6z7oEnKhfnRgk4uMn39VG5tSXu8kN4NLDBgkZNjpBvDKjdx3fNhiqZnAAAAgQDXQI2OpNAnPlYKOhPUZG4OgQF2Yb8hRDH1FEkspfme4zHk4yCXkCH+zV1GT8XNsyznmEaNhEkUtdhfYuRAfVOEAakrsq/opFeJq6XzRgnXeX3uEohCnSKmVOIP/7vyvT0Ydx1ib/l2ndAhIUEuJVOqbH51glRSw3pu3KQbA8ApGwAAAIEA0lUuP8zdmjoxASACeYVE/JrC7AxO/ojVAgK3vm+fJ2mWAg+icwtKDkD4rNQMkicxS/myGU2Qf2/U1ucn6TaT0TF8+npOS7c9s9abn8cHE+f7dmxH4bdU7gRJ+lrbFO0Fz8Ix0CjUxYpfaoMK5p97aa7mT3qDavSyLlnoAowAi9sAAAAUamVua2luc0BmYTJmNTVlMzhmY2EBAgMEBQYH-----END OPENSSH PRIVATE KEY-----

将内容添加到上图的private key中

SSH仿知乎源码

添加测试工程

新建一个自由风格的工程,填写ssh git路径

SSH仿知乎源码

启动构建,查看控制台日志输出

SSH仿知乎源码

我们在Jenkins执行目录下查看代码是否下载成功

SSH仿知乎源码

收藏
分享
海报
0 条评论
55

本站已关闭游客评论,请登录或者注册后再评论吧~