Ken的杂谈
  • Ken的杂谈 (current)
  • 关于
  • 杂谈
    Java Spring Spring Boot Spring Cloud MyBatis C# .NET Core .NET ASP.NET Core ASP.NET ClassLibrary Mono 数据库 MySQL SQL Server 网络 缓存 Web Linux CentOS Ubuntu macOS Windows openEuler Nginx ServiceStack JS/JQ 正则 工具 IDE Grafana Exceptions CI/CD Solution 微服务 Arch Docker 杂谈
  • 系列
    Java 快速入门系列教程 Spring Boot 入门教程 Spring Boot 2.x 入门教程 Spring Cloud 入门教程 .NET Core 快速入门教程 ASP.NET Core 2.1 入门教程 CentOS 7 快速上手教程 Ubuntu快速上手入门教程 Hyper-V基础教程 Docker入门教程
  • GitHub

【Ubuntu快速上手】一、Ubuntu基本命令

Ubuntu @ 2017-07-07 21:45:52 · 阅读:(8309)

一、前言

  • 准备工作

  • 安装Ubuntu虚拟机(参考CentOS):https://ken.io/serie/hyper-v-courses

  • 使用XShell管理Ubuntu:https://ken.io/note/xshell-setup-ssh

二、远程访问

#1、安装网络工具包:
sudo apt-get install net-tools
#2、查看命令:
ifconfig
#3、安装ssh-server
sudo apt-get install openssh-server
#4、安装wget
sudo apt-get install wget

三、systemctl命令

#开机运行服务:
systemctl enable *.service
#取消开机运行
systemctl disable *.service
#启动服务
systemctl start *.service
#停止服务
systemctl stop *.service
#重启服务
systemctl restart *.service
#重新加载服务配置文件
systemctl reload *.service
#查询服务运行状态
systemctl status *.service
#显示启动失败的服务
systemctl --failed

四、安装telnet

#注意需要Root权限
sudo apt-get install xinetd telnetd

五、用户操作

#1、创建用户:
useradd -d / ftpuser
#2、修改密码:
passwd ftpuser

六、防火墙操作

#1、安装
sudo apt-get install ufw
#2、启用|关闭
sudo ufw enable | disbale
#2、查看状态
sudo ufw status
#3、开放端口
sudo ufw allow 80
sudo ufw allow 20000:20010/tcp
#4、关闭端口
sudo ufw delete allow 80
sudo ufw delete allow 20000:20010/tcp
#5、指定IP开发所有端口
sudo ufw allow from 192.168.1.1
#6、开放/关闭SMTP
sudo ufw allow | deny smtp

## 使用systemctl命令开放防火墙服务不代表防火墙功能开启。
## 所以建议统一使用ufw enable | disbale来开关防火墙

七、Vim更新

#适用于desktop版本
#1、卸载tiny版本
apt-get remove vim-common
#2、安装完整版
apt-get install vim

  • 系列名称:Ubuntu快速上手入门教程
  • 下一篇:【Ubuntu快速上手】二、Ubuntu设置静态IP

Ken的杂谈

本文由 ken.io 创作,采用CC BY 3.0 CN协议 进行许可。 可自由转载、引用、甚至修改,但需署名作者且注明出处。

Ubuntu

随笔目录


    © Copyright 2012-2025 Ken的杂谈

    豫ICP备10025012号

    ASP.NET Core(6.0) on Linux