Failed to initialize TiDB environment on remote host when setting up cluster on local machine

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 本机建立集群一直报错Failed to initialize TiDB environment on remote hos

| username: TiDBer_YEiZUU1X

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version] 8.0.0
[Reproduction Path] Offline installation always reproduces
[Encountered Problem: Problem Phenomenon and Impact] Cluster creation failed
[Resource Configuration]

[Attachments: Screenshots/Logs/Monitoring]

| username: TiDBer_YEiZUU1X | Original post link

When actually executing ssh 172.20.1.120, it is directly password-free, but I don’t know why it always reports the error caused by: Failed to execute command over SSH for ‘tidb@172.20.1.120:22’.

| username: 像风一样的男子 | Original post link

I’m too lazy to set up passwordless login, so I just use the account and password for installation:

tiup cluster deploy xxx-cluster v8.0.0 topology.yaml --user root -p
| username: TiDBer_YEiZUU1X | Original post link

Hello, is your cluster deployed on the local machine? I encountered the same password error. After carefully checking the logs, it seems that this error occurred: Password: su: Authentication failure.

| username: 像风一样的男子 | Original post link

There is a setting called PasswordAuthentication set to yes under /etc/ssh/sshd_config.

| username: TiDBer_YEiZUU1X | Original post link

Okay, I’ll give it a try, thank you.

| username: TiDBer_YEiZUU1X | Original post link

After making the changes, the same error still occurs.
By the way, I used the tidb account for the installation, and also used tidb to create the cluster with the command tiup cluster deploy tidb-test v8.0.0 ./topology.yaml --user tidb.
The local IP is 172.20.1.120.

| username: DBAER | Original post link

There is no problem. How about specifying -p to interactively input the password and try again?

| username: TiDBer_YEiZUU1X | Original post link

The interactive password also has this error.

| username: zhanggame1 | Original post link

You can use root to install, delete the tidb user, and the installation program will add it for you. Also, for local installation, it’s best to use the IP 127.0.0.1.

| username: 小龙虾爱大龙虾 | Original post link

Post the error image, so it’s easier to locate the issue.

| username: TiDBer_QYr0vohO | Original post link

su tidb

| username: TiDBer_QYr0vohO | Original post link

Can SSH be passwordless under the tidb user?

| username: TIDB-Learner | Original post link

According to the official documentation “TiDB Environment and System Configuration Check | PingCAP Documentation Center” TiDB 环境与系统配置检查 | PingCAP 文档中心, it is recommended to strictly follow the official documentation for the first successful deployment, and then conduct in-depth research. After that, you can reinstall and verify according to your own ideas.