Password Less Authentication not Working After Giving Full Permission

Hello Team,
Please help me to solve my Problem,
By mistake, I give full permission to /(root) directory. by using the following command " chmod -R 777 / "
after this, the client asks for the password to login via ssh. Before that, I an able to Login without a password.
Please help me to retrieve changes.
Thank you.

You didn't just make your root directory readable, writeable, and searchable by everyone in the world; you made every file on your system readable, writeable, changeable, executable, delectable, and searchable by anyone who is able to access your system in any way shape or form.

I strongly suggest that you shut down the system as quickly as possible.

Then you can boot it up in single-user mode and try to restore your system to a stable point before you destroyed the system's self-protection capabilities by restoring everything from a recent backup dump. (You do perform regular backups, don't you?)

There is no "undo" command that can recover from you making every file on your system readable, writeable, executable, and searchable by everyone in the world!

777 is not the magic sledgehammer to fix all permissions problems. Lots and lots of things will refuse to operate now and any remote clients have the opportunity to destroy everything. You have ruined your system. Restore from backup.

If you have no backup, comparing permissions from another very similar system may help.

What's your OS?
In Solaris and HP-UX the original attributes are stored in the software package DB, and can be restored.

i am using Ubuntu 16.04 LTE

You should restore your system from the backup you made before you did the unwise and ill-fated " chmod -R 777 / " error.

Of course you did a full backup of your server before you did such a dramatic "attempt" at sys admin, right?

If not, when did you perform your last full backup of that server?