ubuntu server設置

一、root用戶支持ssh

# 修改/etc/ssh/sshd_config配置文件
1
#PermitRootLogin prohibit-password 2 PermitRootLogin yes

二、修改用戶名密碼

# sudo passwd
New password: 
Retype new password: 
passwd: password updated successfully

# 修改root用戶密碼
# sudo passwd root
[sudo] password for xxx: 
New password: 
Retype new password: 
passwd: password updated successfully

三、查看Ubuntu版本

# lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:    22.04
Codename:    jammy

# cat /etc/issue
Ubuntu 22.04.1 LTS \n \l


# cat /proc/version
Linux version 5.15.0-43-generic (buildd@lcy02-amd64-076) (gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #46-Ubuntu SMP Tue Jul 12 10:30:17 UTC 2022

四、修改網卡配置

# cat /etc/netplan/00-installer-config.yaml 
# This is the network config written by 'subiquity'
network:
  ethernets:
    enp2s0:
      addresses:
      - 172.16.5.105/23
      # gateway4: 172.16.4.1  // 已棄用
      routes:
        - to: default
          via: 172.16.4.1
      nameservers:
        addresses:
        - 192.168.1.12
      # dhcp4: true
  version: 2

 五、修改vim配置

# 參考
https://www.cnblogs.com/coolYuan/p/10131641.html

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章