You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by "Andrew C. Oliver" <ac...@apache.org> on 2002/08/10 23:38:35 UTC

quick and dirty util to shutdown james

Hi All,

I wrote a quick and dirty util for shutting down JAMES.  Figured I'd 
share it just in case its of interest.

To use it download:

http://www.superlinksoftware.com/killjames.jar

Create a script like this:

------/etc/rc.d/init.d/james-------------------------------
#! /bin/sh


start(){
         echo "starting james.."
         su -l root -c '/root/james/bin/run.sh' &
}

stop(){
         echo "stopping james.."
         su -l root -c '/root/james/bin/shutdown.sh'
}

restart(){
         stop
         sleep 2
         start
}
------shutdown.sh-----------------------------------------------

And a script like this:

java -cp /root/james/bin/killjames.jar de.mud.telnet.JamesKiller 
localhost rootpassword

--------------------------------------------------------------

assumptions:

1. admin is on port 4555 (otherwise change/recompile JamesKiller)
2. root user is "root"
3. killjames.jar is in /root/james with the associated "shutdown.sh" script
4. you're running james as root (tsk tsk tsk)


--------------------------------------------------------------

WARNING WARNING

if you have port 4555 open and you run this from a remote server your
james admin password will be sent in clear text over the internet and
everyone and every script kiddie and his younger brother will hack your
mail server.

---------------------------------------------------------------

Hope this is useful, if not...sorry.

-Andy



PS You may consider it distributed
under the terms of the GPL (I'm not a GPL fanatic, its just I used GPL 
code, its not worth my time to rewrite a telnet handler/etc just to 
distribute it under a less sucky license). I ripped this code off:
http://javassh.org/




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: quick and dirty util to shutdown james

Posted by "Andrew C. Oliver" <ac...@apache.org>.
> Although from your most recent message, perhaps you are saying that your
> program is the one that should have some way to provide the name of the root
> user.
> 
> 	--- Noel

Ahh.. anyhow, I was just sharing this with anyone who needed a way to 
shutdown james in an /etc/rc.d script.  It suits my needs with the admin 
user hard coded as root.

Everyone is free to modify it as they wish.  I don't plan on making a 
Jakarta project out of it ;-).  To recompile it, unjar it into a 
directory and type javac de/mud/telnet/*.java.

now back you your regular programming

-andy




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: quick and dirty util to shutdown james

Posted by "Noel J. Bergman" <no...@devtech.com>.
No, you can't have a null password.  I meant that you can change the name of
the administrative user, as you had asked:

>Actually I meant the James "root" user is "root" which I would
>assume one could change somehow or another....

>             <account login="root" password=""/>

Although from your most recent message, perhaps you are saying that your
program is the one that should have some way to provide the name of the root
user.

	--- Noel


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: quick and dirty util to shutdown james

Posted by "Andrew C. Oliver" <ac...@apache.org>.
Should.  you'll need to pass an empty string to it...  probably

java de.mud.telnet.JamesKiller localhost ""

however login must be root or you need to change it and recompile it 
(very simple)

-Andy

Noel J. Bergman wrote:
>>Actually I meant the James "root" user is "root" which I would
>>assume one could change somehow or another....
> 
> 
> From james-config.xml:
> 
>          <administrator_accounts>
> <!-- CHECKME! Change the default password! -->
> <!-- FILL ME!!!!!!  You must provide a password for your  administrator
> accounts (cannot be blank) -->
>             <account login="root" password=""/>
>          </administrator_accounts>
> 
> Does that count?  ;-)
> 
> 	--- Noel





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: quick and dirty util to shutdown james

Posted by "Noel J. Bergman" <no...@devtech.com>.
> Actually I meant the James "root" user is "root" which I would
> assume one could change somehow or another....

>From james-config.xml:

         <administrator_accounts>
<!-- CHECKME! Change the default password! -->
<!-- FILL ME!!!!!!  You must provide a password for your  administrator
accounts (cannot be blank) -->
            <account login="root" password=""/>
         </administrator_accounts>

Does that count?  ;-)

	--- Noel


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: quick and dirty util to shutdown james

Posted by "Andrew C. Oliver" <an...@superlinksoftware.com>.
np.

Yeah.  Actually I meant the James "root" user is "root" which I would 
assume one could change somehow or another....

Danny Angus wrote:
> Thanks Andy.
> (ps you have to run James as root to get the right ports open)
> 
> 
>>-----Original Message-----
>>From: news [mailto:news@main.gmane.org]On Behalf Of Andrew C. Oliver
>>Sent: 10 August 2002 22:39
>>To: james-user@jakarta.apache.org
>>Subject: quick and dirty util to shutdown james
>>
>>
>>Hi All,
>>
>>I wrote a quick and dirty util for shutting down JAMES.  Figured I'd
>>share it just in case its of interest.
>>
>>To use it download:
>>
>>http://www.superlinksoftware.com/killjames.jar
>>
>>Create a script like this:
>>
>>------/etc/rc.d/init.d/james-------------------------------
>>#! /bin/sh
>>
>>
>>start(){
>>         echo "starting james.."
>>         su -l root -c '/root/james/bin/run.sh' &
>>}
>>
>>stop(){
>>         echo "stopping james.."
>>         su -l root -c '/root/james/bin/shutdown.sh'
>>}
>>
>>restart(){
>>         stop
>>         sleep 2
>>         start
>>}
>>------shutdown.sh-----------------------------------------------
>>
>>And a script like this:
>>
>>java -cp /root/james/bin/killjames.jar de.mud.telnet.JamesKiller
>>localhost rootpassword
>>
>>--------------------------------------------------------------
>>
>>assumptions:
>>
>>1. admin is on port 4555 (otherwise change/recompile JamesKiller)
>>2. root user is "root"
>>3. killjames.jar is in /root/james with the associated
>>"shutdown.sh" script
>>4. you're running james as root (tsk tsk tsk)
>>
>>
>>--------------------------------------------------------------
>>
>>WARNING WARNING
>>
>>if you have port 4555 open and you run this from a remote server your
>>james admin password will be sent in clear text over the internet and
>>everyone and every script kiddie and his younger brother will hack your
>>mail server.
>>
>>---------------------------------------------------------------
>>
>>Hope this is useful, if not...sorry.
>>
>>-Andy
>>
>>
>>
>>PS You may consider it distributed
>>under the terms of the GPL (I'm not a GPL fanatic, its just I used GPL
>>code, its not worth my time to rewrite a telnet handler/etc just to
>>distribute it under a less sucky license). I ripped this code off:
>>http://javassh.org/
>>
>>
>>
>>
>>--
>>To unsubscribe, e-mail:
> 
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Protecting RemoteManager

Posted by "Noel J. Bergman" <no...@devtech.com>.
Andrew C. Oliver [acoliver@apache.org] wrote:
------------------
"WARNING WARNING

if you have port 4555 open and you run this from a remote server your
james admin password will be sent in clear text over the internet and
everyone and every script kiddie and his younger brother will hack your
mail server."
------------------

Edit (james-)config.xml, and change:

      <!--<bind> </bind>-->

to

      <bind>localhost</bind>

which will cause the RemoteManager to listen only on the localhost IP
address.  That will prevent connections from the outside from being able to
attach to the RemoteManager.  Log into your server (preferably with SSH) to
establish a local presence.

	--- Noel


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: quick and dirty util to shutdown james

Posted by Danny Angus <da...@apache.org>.
Thanks Andy.
(ps you have to run James as root to get the right ports open)

> -----Original Message-----
> From: news [mailto:news@main.gmane.org]On Behalf Of Andrew C. Oliver
> Sent: 10 August 2002 22:39
> To: james-user@jakarta.apache.org
> Subject: quick and dirty util to shutdown james
>
>
> Hi All,
>
> I wrote a quick and dirty util for shutting down JAMES.  Figured I'd
> share it just in case its of interest.
>
> To use it download:
>
> http://www.superlinksoftware.com/killjames.jar
>
> Create a script like this:
>
> ------/etc/rc.d/init.d/james-------------------------------
> #! /bin/sh
>
>
> start(){
>          echo "starting james.."
>          su -l root -c '/root/james/bin/run.sh' &
> }
>
> stop(){
>          echo "stopping james.."
>          su -l root -c '/root/james/bin/shutdown.sh'
> }
>
> restart(){
>          stop
>          sleep 2
>          start
> }
> ------shutdown.sh-----------------------------------------------
>
> And a script like this:
>
> java -cp /root/james/bin/killjames.jar de.mud.telnet.JamesKiller
> localhost rootpassword
>
> --------------------------------------------------------------
>
> assumptions:
>
> 1. admin is on port 4555 (otherwise change/recompile JamesKiller)
> 2. root user is "root"
> 3. killjames.jar is in /root/james with the associated
> "shutdown.sh" script
> 4. you're running james as root (tsk tsk tsk)
>
>
> --------------------------------------------------------------
>
> WARNING WARNING
>
> if you have port 4555 open and you run this from a remote server your
> james admin password will be sent in clear text over the internet and
> everyone and every script kiddie and his younger brother will hack your
> mail server.
>
> ---------------------------------------------------------------
>
> Hope this is useful, if not...sorry.
>
> -Andy
>
>
>
> PS You may consider it distributed
> under the terms of the GPL (I'm not a GPL fanatic, its just I used GPL
> code, its not worth my time to rewrite a telnet handler/etc just to
> distribute it under a less sucky license). I ripped this code off:
> http://javassh.org/
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>