Jump to content

Recommended Posts

Server maintain: In windows 2003, i setup a schedule for weekly:

shutdown -r -f -c "Maintain"

 

Q. How i can do this for my Solaris 5 ?

Q. How i can put the Windows 2003 batch command to reboot and change back the password of "Administrator" to the password that i assigned, in case of someone hack and changed.

 

Q. How i can put Solaris 5, script to on reboot execute.

#passwd rootpassword to myoldpassword

#myCppprogram restart

#mail central management

Link to comment
https://forums.phpfreaks.com/topic/135790-solaris-5810-windows-2003/
Share on other sites

A crontab would probably work for the first one.

 

 

 

The second one just sounds dumb to me.  You would need admin access to reset an admin password, so if someone hacks your server, they're unlikely to leave an open admin account just lying around.  You could probably do it in init.d or somewhere though (depend on Solaris).

 

Someone with more Solaris experience than I can probably help you.  (I have no Solaris experience at all ;p.)

  • 1 month later...

Changing the root password via a script is a very bad idea, and I don't think it is possible to have a script run from multiuser state, reboot and the run after the system comes back up.

 

An example of how to shut down daily at 5AM in Solaris is as follows.

 

Crontab Entry

 

0 5 * * * shutdown -y -g30 -i6

 

-y answers the prompt "Are you sure...."

-g Is the grace period (seconds), a message is diplayed to all users logged in, after this the system reboots.

-i Is the init state, state 6 is a reeboot.

 

The way to get the email to be sent is to put a script in your /etc/rc3.d directory. This is called a run level script. When your system reaches multiuser mode it will execute scripts in this directory, provided they follow the correct naming convention and they are executable. The script has to start with a "S" and a number to determine which order the scripts within the directory run. For example the script would be named.

 

/etc/rc3.d/S99_email_cmang.ksh

 

The script would be a one liner.

 

#!/bin/ksh

mailx -s "Server X has been rebooted sucessfully" centralmanagment@xxx.com

 

 

 

Oh hrmmmm....

 

 

Guessing that's a ghetto hack of an rc.local file, since S99 is probably the last thing alphabetically.  On Fedora Core, rc.local is run after the initialization of the run level selected.  (There is 1 rc.local, not one for each level in other words.)

 

 

Guessed Solaris was the same way.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.