Server:我是谁,我在哪里...

给你一台现成的服务器,你该如何了解它?(可以是linux的,也可以是Windows,也可能是mac os),但这里更多的假设是linux吧,因为更加常见,假如你ssh到了一台新服务器,除此之外,别人什么都没告诉你,你该怎么办?

我是谁-第一问

hostname

whoamiid

我是谁-第二问

linux有很多发行版本,每个都有点儿不一样,就比如下载软件的命令就是不一样的,不是每台服务器都是你所熟悉的centos,或者 ubuntu。不要去“我以为…”,而是我先确认一下,怎么确认是我们需要思考的。

How to check os version in Linux command line

比如说说 hostnamectl 命令

1
2
3
4
5
6
7
8
9
10
11
root@saltmaster:~# hostnamectl
Static hostname: saltmaster
Icon name: computer-vm
Chassis: vm
Machine ID: 5ff54f44069c4ce289690d8b20a3a8d4
Boot ID: ca1c7b0381c74fadb52f2065c2bf8648
Virtualization: oracle # 是否使用虚拟化,及哪家的虚拟化,我这里是 vagrant + virtaul box启动的一台服务器
# 如果看到的是 Virtualization: microsoft 这种,就说明是微软的,大概率是azure吧.
Operating System: Ubuntu 18.04.4 LTS
Kernel: Linux 4.15.0-91-generic # 内核版本
Architecture: x86-64 #服务器的架构

我在哪里,几点了-第三问

date

tree

ps

systemctl service

出错了,怎么办-

日志
Application Logs
Event Logs
Service Logs
System Logs

Donate
  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
  • Copyrights © 2019-2024 John Doe
  • Visitors: | Views:

请我喝杯咖啡吧~