Q: How can I logout remotely (from my Sun workstation)?


Disclaimer: This should work in most cases, but not necessarily in all. In particular, if you logged in to a remote host through CDE, you should do the following on that host, not on the one whose console you are using as a display.

Login remotely on the workstation which you want to logout from. Type the following command exactly as is, but on a single line (it is split over two lines here for clarity):


	kill `/usr/ucb/ps guxww | egrep "^$USER .*Xsession" 
	| egrep -v egrep | awk '{print $2}' | sort -n | head -1`

After waiting about a minute, type:

	/usr/ucb/ps guxww | egrep -v $tty

to make sure that processes other than the ones on the terminal you are typing from (remotely) have been killed. (If they haven't, then kill them individually.)

If that doesn't work, you may need to replace kill with kill -9, but that may have some nasty side effects...