Skip to content

Commit

Permalink
Update faq.md (labring#5361)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlhiter authored Feb 19, 2025
1 parent 019a0e1 commit 6348295
Showing 1 changed file with 2 additions and 29 deletions.
31 changes: 2 additions & 29 deletions docs/5.0/i18n/zh-Hans/user-guide/devbox/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,34 +107,7 @@ sudo go run main.go

或者变更你的端口。

## 9、如何在 Devbox 中更换默认的用户为 root 用户

如果你需要在打开本地编辑器时,链接到 Devbox 的用户为 root,可以参考以下的步骤。
首先请确保你的 Devbox 在使用默认的配置时,可以正常连接。
打开本地电脑的 `~/.ssh/sealos/devbox_config`,如果不清楚这个文件在哪里,请参考问题2。

找到你需要切换为 root 用户的配置,例如:

```config
Host usw.sailos.io_ns-rqtny6y6_devbox1234
HostName usw.sailos.io
User devbox
Port 40911
IdentityFile ~/.ssh/sealos/usw.sailos.io_ns-rqtny6y6_devbox1234
IdentitiesOnly yes
StrictHostKeyChecking no
```

修改 `User` 的值为 root,例如:

```config
Host usw.sailos.io_ns-rqtny6y6_devbox1234
HostName usw.sailos.io
User root
Port 40911
IdentityFile ~/.ssh/sealos/usw.sailos.io_ns-rqtny6y6_devbox1234
IdentitiesOnly yes
StrictHostKeyChecking no
```
## 9、如何在 Devbox 中更换默认的用户为 root 用户

保存之后退出打开了 Devbox 的本地编辑器,重新打开编辑器,连接到 Devbox,此时的用户已经切换为 root。
终端里运行`sudo su`即可切换到 root 用户

0 comments on commit 6348295

Please sign in to comment.