LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-08-2009, 11:31 PM   #1
smaddox
LQ Newbie
 
Registered: Sep 2009
Posts: 11

Rep: Reputation: 0
Shutdown/restart alert at ssh login?


Is there an easy way to have sshd send a shutdown alert at login, if a shutdown is currently planned? The alert works fine if people are already logged in, but it does not alert those who login after the command is sent.

Similarly, is there an easy way to send periodic reminders? Maybe just write a script?

Thanks in advance!
 
Old 10-09-2009, 05:37 AM   #2
carltm
Member
 
Registered: Jan 2007
Location: Canton, MI
Distribution: CentOS, SuSE, Red Hat, Debian, etc.
Posts: 703

Rep: Reputation: 99
Sending messages is not something ssh can do. There are three options
you might want to consider.

The /etc/motd file is printed when a user logs in. That would be the
place to put any messages that you want people to see.

If you just want to send a message to all users that are already logged
in, use wall.

If you want to manage the whole process, read the man page for shutdown.
You can schedule the shutdown to happen in the future, prevent new logins,
and send a message to users with one command. You can also use the -k
option to send a message without really scheduling the shutdown.
 
Old 10-12-2009, 12:46 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
pam_nologin is what you want: http://linux.die.net/man/8/pam_nologin
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shutdown script possible to alert about connected USB devices? Roy Prins Linux - Newbie 6 07-23-2008 06:47 AM
shutdown problem. newb alert! mrbutabara Fedora 2 02-16-2007 06:47 PM
Alert for server shutdown sunhui Linux - Software 1 08-02-2006 04:03 PM
Shutdown.....but it restart max_232 Linux - Laptop and Netbook 2 07-08-2005 04:32 AM
Remote SSH login causing system shutdown stevey99 Linux - Networking 2 01-08-2005 03:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:30 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration