Unable to log into iCloud or access the internet using iMac
This is a weird one and sorry in advanced for the long message.
I have been gifted an iMac A1419 (late 2013). The previous owner mentioned, that the "hard drive had become corrupt and he had to wipe and reinstalled the OS". When i turned on the iMac, it would fail to fully boot and error out when on the OS logo.
I booted into the recovery mode menu (Command & R), in disk utility, i erased the drive. I connected the iMac to the my router vie ethernet. Back in the recovery mode menu, i selected reinstall OS X. After going through all the steps, it had reinstalled Mountain Lion with no issues. Going through the set, when iCloud asked for my log in details, it would error out with "Error, can not sign you in at this time". So i skipped logging into iCloud and carried on setting up the iMac. Everything looked normal and correct.
After opening Safari, it would not load any websites i entered. I checked the Network settings and the iMac was connected to the internet (green dot in the ethernet tab). I opened "Network utility" and in the "Info" tab, in the "Interface Information" section, it had all the relevant info. in the "Transfer Statistics" section, in "Sent Packets - 524", "Sent Errors - 0", "Recv Packets - 955", "Recv Errors - 0". In the "Ping" tab, i entered google.com and pressed "Ping". 10 pings were sent and 10 pings were received with zero errors.
In "System Preference", i clicked on iCloud and entered in my details. Again, i would get a "You can't log in at this time" error. i have the previous owners log in details and enter that. It gave the same error message.
Thinking that it could have been a bad install, i wiped the hard drive and reinstalled Mountain Lion and i got the same error message when trying to sign into iCloud during set up. After set up, i removed the ethernet cable and connected via Wi-Fi. Confirmed that the iMac was connected correctly (green dot) and checked info and ping in the "Network Utility" and all were as expected. But again, couldn't log into the iCloud or access an website via Safari.
To make sure that the iMac has the correct settings to connect to the internet, i checked the settings on my MacBook Pro and i can confirm, all of the settings were the same (except for the IP and MAC address of the devices).
Thinking that there was an issue with the Mountain Lion install, i done a fresh install of "Yosemite" and had the same issue. Then done a fresh install of "El Capitan, Sierra, High Sierra" and all have the same issue (after wiping the hard drive each time).
Done some research on Google and YouTube and in the "Advanced" settings on both Wi-Fi and Ethernet, in "TCP/IP" tab, all of the addresses were correct, clicked on "Renewed the DHCP Lease". I pressed "OK" and then "Apply" and tried to connect again and still the same error. Back in the "Network Settings" "Advanced", in the "DNS" tab, i entered my router ip address and 8.8.8.8, 8.8.4.4, 1.1.1.1. Pressed "OK" and "Apply" and tried to log into iCloud and again, the same error.
I have wiped the hard drive and reinstalled Mountain Lion and tried everything again and i still can not log into the iCloud, but i can ping websites.
Any suggestions on how i can fix this?
[Re-Titled by Moderator]
Earlier Mac models