Commando plugin

thuskey

Verified User
Joined
Apr 23, 2004
Messages
141
Location
St Louis
I've got to be honest here, I screwed up last weekend and killed sshd on one of my servers and couldn't get it to come back up. Thanks to the directadmin's plugin feature, I was able to edit the sshd_config file and had it back up and running in no time without a single customer complaint.

From this, came the idea, that I may not always be at a computer that I can conveniently ssh into my server to do a quick command when I need to. Then I remembered a feature in one of the early OSCommerce versions called commando, which allowed you to run command line commands from the admin panel. Yes, it was very bad news for server admins, but great for us resellers who didn't have ssh access at all :)

Hence, a revival of commando, flavored for DirectAdmin. It runs as user admin on the server, and is only available at the admin level in the control panel. I think it should come in rather handy for some of us.

Note, this does not provide full root access to your server by default.

EDIT: To gain root access to the server,use sudo. You will need to add the admin user to the /etc/sudoers file authorizing your desired level of permissions. I set mine like:

admin ALL=(ALL) NOPASSWD: ALL

I was able to test that my sudoers settings were working by running:

sudo /bin/cat /etc/shadow

Here is the url to the download link:
http://www.my1host.com/forum/viewtopic.php?p=320#320

Let me know if you have any problems with it.

Current Release: Version 0.2

Change History:

7/28/2004 changed /usr/local/bin/perl to /usr/bin/perl to match default RedHat server installation.
 
Last edited:
just downloaded it, ill install it and give it a whirl and let you know.

EDIT: although i got a feeling its going to be qwite pointless if it dont give you root access. seeing as you need root access to do qwite a few things now adays.
 
ok the results for trying this baby out.

1. installed and activated fine
2. appeard in da control panel fine
3. went to click it to open it up and run it and it doesnt work. all i see is a blank da control panel screen. think it needs some more work done to it.
 
WingServers said:

3. went to click it to open it up and run it and it doesnt work. all i see is a blank da control panel screen. think it needs some more work done to it.

Is Perl installed in /usr/local/bin/perl on your server? Do you have the CGI.pm installed. I was thinking those were just standards on all DA installations. If not, your right, it will be broke. I can remove the CGI.pm call, that was really just for testing anyway. But do check to see if Perl resides in /usr/local/bin/perl or /usr/bin/perl for me please.

Thanks!
 
It works.

/usr/bin/perl is my path.

Something I don't understand, we are connected to what?

I tried "su -" and it doesn't work.

I'm lost.
 
su did not work because you are not attached to a tty port. also running interactive programs such as vi would be a bad idea because it will spawn the process and leave it running forever.

The program is best used for commands like ls, cat, cp, mv, diff, ps, ect ... Only the commands that are quick to respond and require no additional input.

EDIT: sudo is a valid command, it is only su which will not work when not connected to a vty. Very strange considering the binaries for sudo and su are exactly the same

As for using sudo to gain root access, don't forget to add the admin user to the /etc/sudoers file authorizing your desired level of permissions. I set mine like:

admin ALL=(ALL) NOPASSWD: ALL

I was able to test that my sudoers settings were working by running:

sudo /bin/cat /etc/shadow

Maybe I should make the modification of the /etc/sudoers file automatic during the installation?
 
Last edited:
Back
Top