Linux系统管理初步·科学计算环境搭建(待续)
由于科研需要,负责管理一台服务器虚拟环境(Ubuntu),主要是用户权限管理、系统环境配置和SSH搭建。由于是第一次系统地接触Linux环境,因此许多东西都是从头开始摸索,踩了很多坑才勉力实现了初步的系统搭建和环境维护。
首先需要说明的是,我使用的是macOS环境,版本为macOS Mojave 10.14,服务器环境为Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-38-generic x86_64)。主要需要配置的是Python环境和FTP传输管理。服务器环境配置期间分配了一个公网IP以部署系统环境,部署完成之后将回归内网环境,届时将无法连接外部网络。
文章目录
系统初次启动
远程登录服务器使用SSH协议完成,连接方式为在终端输入ssh root@ip.address
,由于使用的服务器是服务器管理员分配的一个虚拟服务器空间,预先根据需要设置了根目录名和管理员账户。
系统初次启动,需要配置一下文件夹结构,由于本地文件结构初始化为/home/admin/
路径,因此需要根据需要创建新的文件夹结构。
ls -ahl
mkdir python/
mkdir vftp/
初次使用Ubuntu环境,可能需要使用自带的工具下载一些环境包,这时可以使用apt-get
完成,但在国内的网络环境中,从许多官方源下载数据文件速度很慢,因此推荐首先配置Ubuntu下载源(https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/ )。推荐使用清华大学的开源镜像站TUNA来替换各种官方源。
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted