remote-access

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Remote Access with Acquia CLI

使用Acquia CLI进行远程访问

Use when:
  • Opening an SSH shell on a Cloud environment
  • Running a Drush command on a remote environment
  • Downloading or listing Drush aliases
  • Tailing live logs from an environment

适用于以下场景:
  • 在云平台环境中打开SSH shell
  • 在远程环境中运行Drush命令
  • 下载或列出Drush别名
  • 实时查看环境日志

SSH into a Cloud Environment

连接到云环境的SSH

Open an interactive shell in a Cloud Platform environment:
bash
acli remote:ssh <alias>
Alias:
acli ssh
The alias format is
app-name.env
(e.g.
myapp.prod
,
myapp.dev
).
bash
undefined
在云平台环境中打开交互式shell:
bash
acli remote:ssh <alias>
别名:
acli ssh
别名格式为
app-name.env
(例如
myapp.prod
myapp.dev
)。
bash
undefined

Open interactive shell

打开交互式shell

acli remote:ssh myapp.prod
acli remote:ssh myapp.prod

Run a single command without opening a shell

不打开shell直接执行单个命令

acli remote:ssh myapp.prod -- ls -la /var/www/html
acli remote:ssh myapp.prod -- ls -la /var/www/html

Run multiple commands

执行多个命令

acli remote:ssh myapp.prod -- "cd /var/www/html && git log --oneline -5"

---
acli remote:ssh myapp.prod -- "cd /var/www/html && git log --oneline -5"

---

Run Drush Remotely

远程运行Drush命令

Run any Drush command on a Cloud environment without SSHing in manually:
bash
acli remote:drush <drush_command>
Aliases:
acli drush
,
acli dr
bash
undefined
无需手动SSH连接,即可在云环境中运行任意Drush命令:
bash
acli remote:drush <drush_command>
别名:
acli drush
acli dr
bash
undefined

Check Drupal status

检查Drupal状态

acli remote:drush status
acli remote:drush status

Clear caches

清除缓存

acli remote:drush cr
acli remote:drush cr

Run database updates

运行数据库更新

acli remote:drush updatedb
acli remote:drush updatedb

Export configuration

导出配置

acli remote:drush cex

---
acli remote:drush cex

---

Tail Logs Live

实时查看日志

Stream live logs from an environment:
bash
acli app:log:tail
Aliases:
acli tail
,
acli log:tail
Prompts you to select the application, environment, and log type.

流式查看环境的实时日志:
bash
acli app:log:tail
别名:
acli tail
acli log:tail
会提示您选择应用、环境和日志类型。

List Drush Aliases

列出Drush别名

List all Drush site aliases for your Cloud environments:
bash
acli remote:aliases:list
Aliases:
acli aliases
,
acli sa

列出您所有云环境的Drush站点别名:
bash
acli remote:aliases:list
别名:
acli aliases
acli sa

Download Drush Aliases

下载Drush别名

Download Drush aliases for use with local Drush:
bash
acli remote:aliases:download
Options:
bash
acli remote:aliases:download \
  --destination-dir=/path/to/aliases \
  --all                               # download aliases for all applications

下载Drush别名以供本地Drush使用:
bash
acli remote:aliases:download
选项:
bash
acli remote:aliases:download \
  --destination-dir=/path/to/aliases \
  --all                               # 下载所有应用的别名

Best Practices

最佳实践

  1. Use
    remote:drush
    over SSH for Drush commands
    — It handles authentication and environment selection automatically.
  2. Use aliases — Download aliases with
    remote:aliases:download
    so local Drush can target Cloud environments directly.
  3. Tail logs during deploys — Run
    acli app:log:tail
    while deploying to catch errors in real time.

  1. 优先使用
    remote:drush
    而非SSH执行Drush命令
    ——它会自动处理身份验证和环境选择。
  2. 使用别名——通过
    remote:aliases:download
    下载别名,以便本地Drush可以直接指向云环境。
  3. 部署期间实时查看日志——部署时运行
    acli app:log:tail
    以实时捕获错误。

Related Topics

相关主题

  • Pull & Push — Sync code, files, and databases
  • SSH Key Management — Secure access setup
  • Environment Management — Manage environments
  • 拉取与推送 —— 同步代码、文件和数据库
  • SSH密钥管理 —— 安全访问设置
  • 环境管理 —— 管理环境