shamuntoha Posted December 6, 2008 Share Posted December 6, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/135790-solaris-5810-windows-2003/ Share on other sites More sharing options...
corbin Posted December 6, 2008 Share Posted December 6, 2008 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.) Quote Link to comment https://forums.phpfreaks.com/topic/135790-solaris-5810-windows-2003/#findComment-707974 Share on other sites More sharing options...
shamuntoha Posted December 6, 2008 Author Share Posted December 6, 2008 i did this for my w2k3 working. win: reboot_pc.bat: net user administrator back_to_old_password_on_hack shutdown -r -f -c "Daily or weekly" unix: file /etc/ini.. still trying... Quote Link to comment https://forums.phpfreaks.com/topic/135790-solaris-5810-windows-2003/#findComment-707993 Share on other sites More sharing options...
jimbo_head Posted February 6, 2009 Share Posted February 6, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/135790-solaris-5810-windows-2003/#findComment-755814 Share on other sites More sharing options...
corbin Posted February 6, 2009 Share Posted February 6, 2009 He could also just put it in rc.local. Quote Link to comment https://forums.phpfreaks.com/topic/135790-solaris-5810-windows-2003/#findComment-756329 Share on other sites More sharing options...
jimbo_head Posted February 7, 2009 Share Posted February 7, 2009 The equivalent of rc.local in solaris is. /etc/rc3.d/S99local But that is just a naming convention. There is no rc.local script in the /etc directory. Quote Link to comment https://forums.phpfreaks.com/topic/135790-solaris-5810-windows-2003/#findComment-756868 Share on other sites More sharing options...
corbin Posted February 7, 2009 Share Posted February 7, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/135790-solaris-5810-windows-2003/#findComment-756912 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.