第 7 章 Using the command-line assistant to debug or troubleshoot system issues


You can use the command-line assistant powered by RHEL Lightspeed to request information on how to troubleshoot the issues that you face on your system.

To troubleshoot your system, ask a question by using the following syntax: c + "<question>". For example:

  • $ c "how to troubleshoot network errors"
  • $ c "I cannot access my server with SSH. Can you give me a list of things to troubleshoot?"
  • $ c "I am failing to start sssd process"
  • $ c "I need to boot into a different kernel"
  • $ c "how to troubleshoot SSHD failing to start"
  • $ c "how do I find all the files in the /etc that have been modified in the last hour"
  • $ c "I am failing to start sssd process"

You can use the command-line assistant powered by RHEL Lightspeed to troubleshoot an SSHD service that fails to start.

You can use these command-line assistant features:

  • An optional terminal capture feature in the command-line assistant to reference the output of previous commands when interacting with the command-line assistant.
  • Piping data into the command-line assistant.

Prerequisites

  • You have enabled the command-line assistant.
  • You have root access to your system.

Procedure

  1. Check the SSHD status and restart it.

    $ sudo systemctl status ssh
    $ sudo systemctl restart ssh
  2. Enable the optional command-line assistant terminal capture feature:

    $ c shell --enable-capture
  3. Use the -w 1 "your_question" option to specify to include the output from the last command that was run.

    $ c -w 1 "what_is_this"
    • If you specify the number 2, that references the output from the second-to-last command. This is also true for the additional numbers.
    • You can also specify a prompt to run with the command and ask "help me understand the output", and reference the output with the error, so that the command-line assistant understands that you are asking for more details on what the error is.

      The command-line assistant processes the request and provides several possible solutions. In the example, you can use the suggestion to run the journalctl -xeu sshd.service command to check the log files.

  4. Run that journalctl command and check the log files to identify potential issues.

    $ journalctl -xeu sshd.service
  5. Ask the command-line assistant to generate a command on how to fix this typing error.

    $ c "what is the command that I can use to change 'Porrt' to 'Port' in the /etc/ssh/sshd_config file?"
  6. Run the command suggested by the command-line assistant as a sudo user. For example:

    $ sudo sed -i s/Porrt/Port/g /etc/ssh/sshd_config

Verification

  • Restart the SSHD service and check the status of the SSHD.

    $ sudo systemctl restart sshd
    $ sudo systemctl status sshd
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部