How to logout from .tcshrc? (never log in)
I don't want to just change the user's shell to /nologin - I want their login to execute some commands, then log out, but if I put "exit" or "logout" into .tcshrc, it just gives "Not a login shell."
What I'm trying to do is make a user on each one of my nodes (I have 11) called "power" (or something along those lines), set that user up with public key authentication, and then write a simple foreach loop (or script) that I can execute from my computer that will log in to each one of the nodes and shut it down. I made a user called power, gave it sudo privileges, put "sudo umount -a" and "sudo poweroff" into power's .tcshrc. It does the unmount and the poweroff, but it doesn't log back out with the "exit" command at the end of .tcshrc. If it would log out on its own, I wouldn't' have to type "exit" 11 times.
So, is there a way to exit from the .tcshrc (or something similar), or is there a better way I can power down all of my machines than the one I've explained?
Last edited by BrianK; 03-08-2004 at 01:13 PM.