在aliyun的云服务器Debain12系统上面安装git

摘要:本文为个人测试目的搭建aliyun上的Debain服务器,纯属测试环境。

一、阿里云上部署Debain 12,具体步骤参考阿里云官网

  1. 订购99元/年云计算资源+DNS/年,赶上优惠活动132元,做简单的lab够用了。

  2. 创建计算机

  3. 创建DNS

  4. 生成SSH Private Key,pem文件并下载

二、使用PuTTY通过Private Key连接Debain 12,同时在连接时自动保存PuTTY输出log

1.将.pem文件转换成.ppk文件

1.1下载PuTTYgen, 官网下载地址:https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

1.2打开PuTTYgen,点击Load导入pem文件,提示成功导入,点击Ok,再点击Generate生成ppk文件即可。

      

2.使用Putty加载.ppk密钥,并登录Debian

2.1下载PuTTY,下载链接同上文PuTTYgen。

2.2创建新的链接session,先输入Hostname或都IP地址, 你想保存的Sessions名字,然后点击一下Save。

2.3开启Session logging, Log file name要使用绝对路径,不要只填写一个文件名。

2.4展开Connection-->SSH-->Auth-->Credetials, 在Private key file选项处,点击Browser,选择ppk证书。

2.5再次回到Session菜单,先点面Save按钮,将上面的设置保存到这个session中。然后点面Open按钮,尝试打开SSH连接远程服务器。

2.6第一次发起连接需要Accept服务器证书,然后输入root,回车,bingo!连接成功啦,

2.7然后随便输入2个命令,e.g. date,pwd,回到log文件夹,可以看到新的log文件已经生成了。注意,根据我的测试当输出行数较少时,可能不会马上生成文件,缓存在内存里了,过一会就会生成log文件了。大功告成!!

三、安装git

1.升级apt-get,通过apt update和apt upgrade来更新和升级。

root@FreeSWITCH01:~# apt update
Hit:1 http://mirrors.cloud.aliyuncs.com/debian bookworm InRelease
Hit:2 http://mirrors.cloud.aliyuncs.com/debian-security bookworm-security InRelease
Hit:3 http://mirrors.cloud.aliyuncs.com/debian bookworm-updates InRelease
Hit:4 http://mirrors.cloud.aliyuncs.com/debian bookworm-backports InRelease
Hit:5 https://freeswitch.signalwire.com/repo/deb/debian-release bookworm InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
root@FreeSWITCH01:~# apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@FreeSWITCH01:~#

2.安装git,apt install git

root@FreeSWITCH01:~# apt install git
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
git is already the newest version (1:2.39.2-1.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@FreeSWITCH01:~#

3.查看git版本,git --version 

root@FreeSWITCH01:~# git --version
git version 2.39.2
root@FreeSWITCH01:~#

  

posted @ 2024-04-28 17:04  Chenny_云淡心亦淡  阅读(43)  评论(0编辑  收藏  举报