$ ssh-keygen -t rsa -P ""
Generating public/private rsa key pair.
Enter file in which to save the key (/home/dhruvhadoop1/.ssh/id_rsa): cat /home/hadoopuser/.ssh/id_rsa.pub >> /home/hadoopuser/ .ssh/authorized_keys
open cat /home/hadoopuser/.ssh/id_rsa.pub >> /home/hadoopuser/ .ssh/authorized_keys failed: No such file or directory.
Saving the key failed: cat /home/hadoopuser/.ssh/id_rsa.pub >> /home/hadoopuser/ .ssh/authorized_keys.
$ chmod 600 authorized_keys
chmod: cannot access ‘authorized_keys’: No such file or directory
$ chmod 600 authorized_keys
chmod: cannot access ‘authorized_keys’: No such file or directory
答え1
これがきっかけでした
Enter file in which to save the key (/home/dhruvhadoop1/.ssh/id_rsa)
ファイルパスを回答していません。
したがって、次の方法で再度生成を開始します。
su - hadoopuser
ssh-keygen -t rsa -P ""
デフォルト値または別のファイル名を使用しますが、次のようなコマンドは使用しませんcat ...
。
/home/hadoopuser/.ssh/id_rsa.pub
その後
cat /home/hadoopuser/.ssh/id_rsa.pub | sudo tee -a /home/hadoopuser/.ssh/authorized_keys
sudo chmod 600 /home/hadoopuser/.ssh/authorized_keys/authorized_keys