I encoutered some problems while I was using ssh-keygen, it turns out to be originating from privileges setting up.
The following way turns out to be working.
1.Do not set up your home directory to be “777”, it will not work. I set it to be “755”
And then it works well.