Execute Cd ~. SSH to find SSH directory not found

Time:2020-1-14
When configuring the password free login, you may encounter the following problem if you are a new machine 

[[email protected] ~]# cd ~/.ssh
-bash: cd: /root/.ssh: No such file or directory

Execute Cd ~. SSH to find SSH directory not found

This is because the root user SSH has not been used to log in, and the folder will be generated automatically after executing the SSH operation
Execute SSH hostname
Then follow the steps to enter the yes password

Execute Cd ~. SSH to find SSH directory not found

Success