1
将SSH密钥保存在home而不是root中
当我尝试使用创建SSH密钥时 sudo ssh-keygen -t rsa 我收到了请求: Enter file in which to save the key (/root/.ssh/id_rsa): 但是,我希望保存文件 /home/user2/.ssh/id_rsa。当我进入该目录时,我收到此错误: Saving key "/home/user2/.ssh/id_rsa" failed: No such file or directory 任何进入不同目录的尝试都会返回错误。 我怎样才能生成密钥 /home/user2/.ssh/id_rsa? 编辑:当我删除 sudo 我遇到这个问题: Generating public/private rsa key pair. Enter file in which to save the key (/home/hduser/.ssh/id_rsa): Enter passphrase (empty for …