登入您的 http://homeassistant.local:8123/ 智慧家庭主機,於【設定】=> 附加元件 => 並開啟【附加元件商店】,我們現在要安裝 Advanced SSH & Web Terminal。尋找【Advanced SSH & Web Terminal】這個擴展程式並點擊安裝,安裝完後先不用急著點擊啟動。我們需要額外的設定才能讓這個擴展程式正常運作。
1. 點擊 Advanced SSH & Web Terminal 程式中的設定選項,我們要針對登入 ssh 的帳號與密碼設定,並將連線Port 也一併更改。
2. 看到設定選項,將 username 與 password 修改你想要的登入帳號與密碼,更新完後記得點擊儲存。
3. 修改 變更附加元件公開之主機通訊埠 將原本 22 改為 222 ,因為系統已經占用了 22 Port ,所以這裡不能設定為22 ,或改為你喜歡的 port 。更新完後記得點擊儲存。
4. 記得 reload 重整一下 HA 系統,看你剛剛儲存的參數有沒有正確存檔。如果無誤就可以直接於 Advanced SSH & Web Terminal 資訊業面直接點擊啟動,之後點擊看一下【日誌】。正常運作的訊息最後應該會有下面訊息。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service base-addon-banner: starting ----------------------------------------------------------- Add-on: Advanced SSH & Web Terminal A supercharged SSH & Web Terminal access to your Home Assistant instance ----------------------------------------------------------- Add-on version: 17.2.0 You are running the latest version of this add-on. System: Debian GNU/Linux 11 (bullseye) (aarch64 / qemuarm-64) Home Assistant Core: 2024.5.3 Home Assistant Supervisor: 2024.05.1 ----------------------------------------------------------- Please, share the above information when looking for help or support in, e.g., GitHub, forums or the Discord chat. ----------------------------------------------------------- s6-rc: info: service base-addon-banner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service base-addon-log-level: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service base-addon-log-level successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service init-ssh: starting s6-rc: info: service init-mysql: starting s6-rc: info: service init-mosquitto: starting s6-rc: info: service init-docker: starting s6-rc: info: service init-docker successfully started s6-rc: info: service init-mysql successfully started s6-rc: info: service init-mosquitto successfully started [18:23:43] WARNING: [18:23:43] WARNING: Logging in with a SSH password is security wise, a bad idea! [18:23:43] WARNING: Please, consider using a public/private key pair. [18:23:43] WARNING: What is this? https://kb.iu.edu/d/aews [18:23:43] WARNING: [18:23:43] NOTICE: RSA host key missing, generating one... Generating public/private rsa key pair. Your identification has been saved in /data/ssh_host_rsa_key Your public key has been saved in /data/ssh_host_rsa_key.pub The key fingerprint is: SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx root@a0d7b954-ssh The key's randomart image is: +---[RSA 3072]----+ |E+*B++. | |o==**+.. | |++=B=o= | |+==+Xo o | |o..B =o S | | o = . | | . . | | | | | +----[SHA256]-----+ [18:23:44] NOTICE: ED25519 host key missing, generating one... Generating public/private ed25519 key pair. Your identification has been saved in /data/ssh_host_ed25519_key Your public key has been saved in /data/ssh_host_ed25519_key.pub The key fingerprint is: SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxx root@a0d7b954-ssh The key's randomart image is: +--[ED25519 256]--+ | ..=*E+ | | +.==oo | | =+o+ | | ..o+ | | So+.. | | +o=o.. .| | o+=o+o.| | .B*+o| | .o+*=+| +----[SHA256]-----+ s6-rc: info: service init-ssh successfully started s6-rc: info: service init-user: starting [18:23:45] NOTICE: Session sharing has been disabled! s6-rc: info: service init-user successfully started s6-rc: info: service ttyd: starting s6-rc: info: service sshd: starting s6-rc: info: service sshd successfully started s6-rc: info: service ttyd successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started [18:23:46] INFO: Starting the ttyd daemon... [18:23:46] INFO: Starting the SSH daemon... Server listening on 0.0.0.0 port 222. Server listening on :: port 222. |
正確安裝與啟動後,於 Advanced SSH & Web Terminal 資訊頁面,你會看到右上角有一個綠燈呈現,此外於頁尾的部分會看到一個 【開啟 WEB UI】點擊後就會開啟 ssh 的視窗。你就可以開始進行操作你要的項目。