You use the exit(1) command to log out from a remote system.
The following example shows the user winsor logging out from the system castle.
castle% exit castle% logout Connection closed. paperbark%