LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 03-08-2004, 01:12 PM   #1
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
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?

Thanks

Last edited by BrianK; 03-08-2004 at 01:13 PM.
 
Old 03-12-2004, 09:45 AM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
I would think if your powering down a machine there would be no reason to need to logout as its shutting down. Either that or I'm just really confused in what your trying to accomplish.
 
Old 03-18-2004, 04:25 PM   #3
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Original Poster
Rep: Reputation: 51
Quote:
Originally posted by trickykid
I would think if your powering down a machine there would be no reason to need to logout as its shutting down. Either that or I'm just really confused in what your trying to accomplish.
for speed and because you don't always get your shell back when ssh shuts down while you're still logged in (well, at least I don't)
 
Old 04-13-2004, 02:47 AM   #4
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Original Poster
Rep: Reputation: 51
incase anyone comes here looking for the same answer...

man ssh - ssh [-l login_name] hostname | user@hostname [command]

so I just:
Code:
ssh root@server '(poweroff)'
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I log in as root without having to logout in FC4 MurX Linux - Software 4 10-26-2005 06:08 PM
Editing .tcshrc problems boydasilva Linux - Newbie 16 12-10-2004 07:35 AM
Strange results in /var/log/apache/access.log subt13 Linux - Security 2 08-03-2004 01:21 PM
pppd logging to /var/log/ppp.log problem mrtwice Linux - Software 1 01-10-2004 05:38 PM
On gnome / x logout run "logout" ?? once here Linux - Software 1 01-09-2004 02:53 PM


All times are GMT -5. The time now is 04:51 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration