Loading... > 环境:Ubuntu18.04 内网 # 获取权限 使用root账号登录到服务器 非root账户需要执行```sudo -i```命令输入账号密码获取root权限 如下图: ![获取权限](https://hwcloud.sdqps.top/ShareImages/PicGo/20230829/4d38f6bf5af3411a804a11ab536c8a84.png) # 上传运行时安装包 > 将运行时安装包上传到```/root```目录下 ## 命令行 上传本地文件到服务器 scp /path/filename username@servername:/path 例如scp /var/www/test.php root@192.168.0.101:/var/www/ #把本机/var/www/目录下的test.php文件上传到192.168.0.101这台服务器上的/var/www/目录中 ## 可视化管理软件FinalShell Windows版下载地址: http://www.hostbuf.com/downloads/finalshell_install.exe macOS版下载地址: http://www.hostbuf.com/downloads/finalshell_install.pkg 操作步骤: ![上传运行时](https://hwcloud.sdqps.top/ShareImages/PicGo/20230829/7484c538e50f4146819fff390f850b3d.png) ![等待](https://hwcloud.sdqps.top/ShareImages/PicGo/20230829/6b4e0257a88b4239aa01b0651bd19fe4.png) ![成功](https://hwcloud.sdqps.top/ShareImages/PicGo/20230829/ffb0ea7b24f14c6ea875c1efc58242a3.png) ## 解压安装包到文件夹 1. 执行```mkdir .dotnet``` 创建```.dotnet```文件夹,创建完成后不可见,可以执行 ```ll```命令查看 2. 执行 ```tar zxf aspnetcore-runtime-6.0.21-linux-x64.tar.gz -C .dotnet``` (将```aspnetcore-runtime-6.0.21-linux-x64.tar.gz``` 解压到 ```.dotnet```文件夹) 操作如下图: ![步骤](https://hwcloud.sdqps.top/ShareImages/PicGo/20230829/f235a66541604a2bb1074aa90deca213.png) ## 修改环境变量 1. 执行 ```vim /etc/profile``` 命令编辑环境变量文件 ![profile](https://hwcloud.sdqps.top/ShareImages/PicGo/20230829/7fe09ea9fd994e279192da9f87c3907f.png) 2. 按下键盘的 ```insert```键或```i```键 提示变为 INSERT 即可输入 ![insert](https://hwcloud.sdqps.top/ShareImages/PicGo/20230829/8d520d6a9d584d07b0f4d87d52469663.png) 3. 键入 ```shell export DOTNET_ROOT=$HOME/.dotnet export PATH=$PATH:$HOME/.dotnet:$HOME/.dotnet/tools ``` ![export](https://hwcloud.sdqps.top/ShareImages/PicGo/20230829/25f7746bcdc54a52849b796e59716c72.png) 4. 按下 ```ESC``` 键后输入```:wq```保存修改 ![save](https://hwcloud.sdqps.top/ShareImages/PicGo/20230829/e15f09fd4d574855a0f1b99736b108fd.png) 5. 执行 ```source /etc/profile```刷新修改 6. 检查 dotnet运行时 ![check](https://hwcloud.sdqps.top/ShareImages/PicGo/20230829/e96de1f77f6b46a29e2f8d88fd1c02d2.png) 7. 断开当前登录,再次登录查看 ![relink](https://hwcloud.sdqps.top/ShareImages/PicGo/20230829/f7ddc34412b743298176ad412ae42a03.png) 最后修改:2023 年 08 月 29 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 3 如果觉得我的文章对你有用,请随意赞赏