Not sure what you mean by "via iCloud." If they're on the same network you should just be able to go to shared in the sidebar. In Finder Preferences/Sidebar make sure Connected Servers and Bonjour is checked.
Well, installing Yosemite on my iMac and setting up the laptop was a bit different. You have the option of signing into iCloud and it sets up your stuff from iCloud.
So when I open up the laptop or wake the screen on my iMac, I enter in the password for my iCloud account to log into my computer. Never done that before.
So that's probably why I logged into my iMac via iCloud. I tried logging in as registered user, but it rejected my password.
Chose to log in with AppleID and now it won't log out