Nohup and the difference between logout and exit on a remote shell

Solution 1:

logout is an internal command of the shell. So generally the answer is shell-dependent. From man bash:

logout – Exit a login shell.

From man zsh:

logout [ n ] – Same as exit, except that it only works in a login shell.

So they're completely the same, but logout will simply refuse to work for non-login shells. What is a login shell can be read in manual pages.