2023年7月20日 星期四

FreeIPA 一般帳號加入網域所需權限

所需權限

DNS Administrators
Host Administrators
Host Enrollment

變更 sssd 預設 shell

編輯 /etc/sssd/sssd.conf

default_shell = /bin/bash
override_shell = /bin/bash

Dell N1548管理界面相關指令

停用 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


Dell N1548 log 相關設定

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.

Dell N1548 switch 相關設定

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

2023年7月6日 星期四

建立自訂 Systemd 服務

編輯 /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

cannot find package "github.com/mattn/go-sqlite3"

apt install -y git gcc 

export GO111MODULE=off

go get github.com/mattn/go-sqlite3

Linux 傳送訊息給使用者方式

write

wall

xmessage $USER "中文測試"

notify-send $USER "系統公告 \n中文"

2023年7月4日 星期二

Debian 11 升級 12

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

Debian 10 更新至 11

確認 存儲庫及刪除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