### SSH 連線 (SSH Connection) 1. **基本連線格式** (Basic Connection Format) - 格式:`ssh 帳號@主機IP` - 例:`ssh username@domain.example` 2. **使用私鑰檔案連線** (Using Identity File for Connection) - 連線命令:`ssh -i 私鑰檔案 使用者名稱@域名` (Command: `ssh -i keyfile.pem username@domain.example`) - 私鑰檔案權限設定:`chmod go= mykey.pem` 或 `chmod 400 mykey.pem` 用於解決過度開放權限的問題。 3. **設置短名稱連線** (Setting Short Name for Connection) - 在 `~/.ssh/config` 中設置 (Setting in `~/.ssh/config`): ``` Host shortName HostName domain.example User my-user-name IdentityFile ~/.ssh/mykey.pem ``` - 透過配置,可簡化連線指令 (Simplifies Connection Command): - 之後可使用 `ssh shortName` 直接連線,自動使用指定的用戶名和私鑰文件。 ### Linux chmod 命令 (Linux chmod Command) 1. **基本概念** (Basic Concept) - 用於控制文件權限 (Used for Controlling File Permissions). - 權限分類:文件所有者(Owner)、用戶組(Group)、其他用戶(Other Users)。 2. **命令語法** (Command Syntax) - `chmod [選項] 權限設定 文件名` (Syntax: `chmod [options] mode file...`) - 權限設定:`[ugoa...][[+-=][rwxX]...][,...]` -  3. **權限修改說明** (Permission Modification Details) - 使用符號模式,可以分別為不同用戶類型設置或修改權限。 - `chmod a+r file`:給所有用戶增加讀權限。 - `chmod +rwx file`:給所有用戶增加讀寫執行權限。 - `chmod u=rw,go= file`:為文件所有者設定讀寫權限,清除其他用戶的所有權限。 - `chmod -R u+r,go-r docs`:對目錄docs和其子目錄結構中的所有文件給用戶增加讀權限,而對用戶組和其他用戶刪除讀權限。 ### Linux ls 命令 (Linux ls Command) 1. **基本功能** (Basic Function) - 顯示指定目錄下的內容 (Display Contents of Specified Directory). 2. **命令語法** (Command Syntax) - `ls [選項] [文件名...]` (Syntax: `ls [options] [name...]`) - 常用選項:`-a` (顯示所有文件), `-l` (長格式顯示), `-t` (按修改時間排序). 3. **實例** (Examples) - 顯示當前目錄文件:`ls -l` - 包括隱藏文件的詳細列表:`ls -al` - 遞迴顯示所有文件和子目錄:`ls -R`
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.