所需權限
DNS Administrators
Host Administrators
Host Enrollment
停用 Telnet
ip telnet server disable
停用 HTTP
no ip http server
啟用 HTTPS
crypto certificate 1 generate key
ip https certificate 1
ip http secure-server
啟用 SSH
crypto key generate rsa
crypto key generate dsa
ip ssh server
其他相關指令
show ip telnet
show ip http server status
username
show users accounts
show users login-history
no logging on Disable all logging except to the console.
no logging buffer Disable logging to the logging buffer.
no logging monitor Disable logging to terminal lines.
no logging console Disable console logging.
logging buffered <0-7> Set logging severity level for buffer. (default = 7)
logging console <0-7> Set logging level severity for console. (default = 7)
logging monitor <0-7> Set logging level severity for monitor. (default = 7)
logging trap <0-7> Set logging level severity for traps. (default = 6)
logging history <0-7> Set logging level severity for history (default = 4)
logging buffered <40960-524288> Set logging buffer size (default = 40960)
logging history size <0-500> Set logging history size. (default = 1)
logging [[logserver ip]]
其他相關
alerts Immediate action needed (severity=1)
critical Critical conditions (severity=2)
debugging Debugging messages (severity=7)
emergencies System is unusable (severity=0)
errors Error conditions (severity=3)
informational Informational messages (severity=6)
notifications Normal but significant conditions (severity=5)
warnings Warning conditions (severity=4)
clear logging — clears the logging buffer.
show logging — displays the logging setting and system messages in the internal buffer.
sntp 較時相關指令
sntp unicast client enable
sntp server [[ip]]
clock summer-time recurring USA
clock timezone +7
設定主機名、IP
hostname [[hostname]]
ip address
ip name-server [[dns-server]]
其他相關指令
show clock
show sntp status
show ip interface
show hosts
show switch
show version
編輯 /etc/systemd/system/log_server.service
[Unit]
Description=MySysLog Server
[Service]
Type=simple
ExecStart=/root/syslog/s1.php
Restart=always
[Install]
WantedBy=multi-user.target
變更 權限
chmod 644 /etc/systemd/system/log_server.service
重新載入 Systemd 設定檔
systemctl daemon-reload
Systemd 服務說明文件
man systemd.unit
man systemd.service
man systemd.exec
apt install -y git gcc
export GO111MODULE=off
go get github.com/mattn/go-sqlite3
sudo apt update && sudo apt upgrade -y
編輯/etc/apt/sources.list 將 bullseye 替換 bookworm
apt update
apt upgrade --without-new-pkgs -y
apt full-upgrade -y
cat /etc/debian_version
reboot
apt --purge autoremove -y
確認 存儲庫及刪除package 的保留狀態
apt-mark showhold
apt-mark unhold [package_name]
apt update && sudo apt upgrade
apt install gcc-8-base
編輯 /etc/apt/sources.list 移除舊儲存庫並加入
deb http://deb.debian.org/debian bullseye main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb http://security.debian.org/debian-security bullseye-security main
deb http://ftp.debian.org/debian bullseye-backports main contrib non-free
apt update
apt full-upgrade -y
確認更新版本
cat /etc/debian_version
重新開機
systemctl reboot