Archive for the tag 'direct'

Installing Softaculous in Direct Admin

Note: Before starting the installation make sure ionCube Loaders are enabled. Otherwise you will not be able to Install Softaculous. The ionCube Loaders can be downloaded at the ionCube Downloads

Now SSH to your server and enter following commands:

cd /usr/local/directadmin/plugins
wget -N http://www.softaculous.com/da/install_softaculous.php
chmod 755 install_softaculous.php
/usr/local/bin/php /usr/local/directadmin/plugins/install_softaculous.php

The Installer will start showing the Installation Processes and when done will indicate the same. NOTE: Scripts will be downloaded during this process. The Download Activity will also be shown on the screen.

Step 1 Add your admin user to the ‘wheel’ group so that you will be able to ’su -’ to root, otherwise you may lock yourself out of root.

Adding user to the wheel group.

usermod -g wheel username

Edit /etc/ssh/sshd_config file.

vi /etc/ssh/sshd_config

Next, find the line PermitRootLogin yes and Uncomment it and make it look like PermitRootLogin no

Now restart SSH

/etc/rc.d/init.d/sshd restart
SBDavid

How to disable direct root login

How to disable direct root login

Direct login for the root user is a major security issue. We can disable direct login access to reduce the security risk. This way we can have two separate passwords for root access which makes the box more secure. Also we are using the protocol 2 which is newer and more secure.

1. SSH into your server as ‘admin’ and gain root access by su

2. Copy and paste this line to edit the file for SSH logins

vi /etc/ssh/sshd_config

3. Find the line

Protocol 2, 1

4. Uncomment it and change it to look like

Protocol 2

5. Next, find the line

PermitRootLogin yes

6. Uncomment it and make it look like PermitRootLogin no

7. Save the file Ctrl+X then Y then enter

8. Now you can restart SSH

/etc/rc.d/init.d/sshd restart

Now, no one will be able to login to root with out first loggin in as admin and ’su -’ to root.

Be sure that you remember both the passwords!

SBDavid

Disable direct root login via ssh

Disable direct root login via ssh

Please follow the given steps to disable direct root login access to the server via shell prompt.

STEP 1: Create a user and add it to the wheel group

SSH into your server as root and follow the below commands to create a user.

$ groupadd test
$ useradd test -gtest
$ passwd test

You can create any user instead of “test”.

STEP 2: Add user to wheel group

You can add the user at the end of the ‘group’ file.

$ grep wheel /etc/group
wheel:x:10:root

Add the user test:

wheel:x:10:root,test

For CPanel Servers, do the following.

1. Log into your WHM and click on “Manage Wheel Group Users”.

2. Select the user (Here it is “test”) and click ‘Add to group’.

3. Before disable the root access, check if the user can login and su – to gain root privileges.

SSH into your server as ‘test’

Login as: test

Password : enteryouruserpasswordhere

su –

password: enter root password here

STEP 3: Disable Direct Root Login

1. Copy and paste this line to edit the file for SSH logins

$ vi /etc/ssh/sshd_config

2. Find the line

Protocol 2, 1

3. Uncomment it (Remove #) and change it to look like

Protocol 2

4. Next, find the line

PermitRootLogin yes

5. Uncomment it (Remove #) and make it look like PermitRootLogin no

6. Save the file.

Now, no one will be able to login to root with out first logging in as ‘test’ and ’su -’ to root.