2022年5月30日 星期一

關閉 SSH Host Key 及 known_hosts

指令列
ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no"  ssh-host

設定檔  ~/.ssh/config,/etc/ssh/ssh_config 
Host *
   StrictHostKeyChecking no
   UserKnownHostsFile /dev/null
   LogLevel ERROR

Host 192.168.0.*
   StrictHostKeyChecking no
   UserKnownHostsFile /dev/null
   LogLevel ERROR

2022年5月16日 星期一

Apache2 Rewrite 設定範例

開啟 Rewrite模組
a2enmod rewrite

確認
apache2ctl -M | grep rewrite

編輯 /etc/apache2/sites-enabled/000-default.conf  加入
<Directory "/var/www/html">
 AllowOverride All
</Directory>

編輯 /var/www/html/.htaccess 加入
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php [L]
</IfModule>

或直接加在 </VirtualHost>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php [L]
</VirtualHost>

System policy prevents control of network connections

編輯 /etc/polkit-1/localauthority/50-local.d/47-allow-networkd.pkla

[Allow Network Control all Users]
Identity=unix-user:*
Action=org.freedesktop.NetworkManager.network-control
ResultAny=no
ResultInactive=no
ResultActive=yes

dnsmasq pxe boot 範例

#http://boot.ipxe.org/ipxe.efi
#http://boot.ipxe.org/undionly.kpxe
#dhcp-match=set:<tag>,<option number>|option:<option name>|vi-encap:<enterprise>[,<value>]
#dhcp-boot=[tag:<tag>,]<filename>,[<servername>[,<server address>|<tftp_servername>]]

dhcp-match=set:efi-x86_64,option:client-arch,7
dhcp-match=set:efi-x86_64,option:client-arch,9
dhcp-match=set:efi-x86,option:client-arch,6

dhcp-boot=tag:efi-x86_64,ipxe.efi,,192.168.92.241
dhcp-boot=tag:efi-x86,ipxe.efi,,192.168.92.241

dhcp-match=set:X86-64_EFI_HTTP,option:client-arch,16
dhcp-boot=tag:X86-64_EFI_HTTP,http://192.168.92.241/ipxe.efi

dhcp-match=set:bios,option:client-arch,0
dhcp-boot=tag:bios,undionly.kpxe,,192.168.92.241

dhcp-match=set:ipxe,175
#dhcp-match=set:ipxe-http,175,19
#dhcp-match=set:ipxe-https,175,20

#dhcp-boot=tag:ipxe,ipxe,,192.168.92.241
dhcp-boot=tag:ipxe,http://192.168.92.241/ipxe
dhcp-boot=http://192.168.92.241/ipxe.efi

Authentication is required to create a color managed device

編輯 /etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla

[Allow Colord all Users]
Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile
ResultAny=no
ResultInactive=no
ResultActive=yes

Dell Wyse 3040 Thin Client 預設 BIOS 密碼

1.F2 進入 BIOS 畫面

2.輸入密碼 Fireport