gpt4 book ai didi

macos - 如何在 MacOS 中避免 "ssh localhost"密码?

转载 作者:行者123 更新时间:2023-12-02 20:33:25 26 4
gpt4 key购买 nike

我正在配置本地 Hadoop 集群,但密码配置有问题。

当我输入

ssh localhost

显示此消息:
ssh localhost
key_load_public: invalid format

我已经尝试使用这些命令来替换我以前的授权 key :
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

但它没有用。

最佳答案

您可以创建 .config文件在您的~/.ssh目录,然后添加凭据。

像这样,

// ~/.ssh/config
# SSH Host configuration file

# Default for all
Host *
ForwardAgent no
ForwardX11 yes
ForwardX11Trusted yes

Host <hostname_here>
HostName <ip_address>
User <user_name>

由于您的问题似乎与键更相关,您可以尝试使用 ssh -i <your key file> username@ip_addr -p <port>

关于macos - 如何在 MacOS 中避免 "ssh localhost"密码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52249847/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com