Translate

Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Tuesday, 25 March 2014

Restrict Root Access to server



Adding user with root privileges
sudo useradd -m testuser
sudo passwd testuser
sudo usermod -s /bin/bash testuser

Restart ssh
/etc/init.d/ssh restart

Check your access can ssh but not able to have root access
Open the file sudoers  
vim /etc/sudoers

Add the following lines below the root line in the file
testuser ALL=(ALL:ALL) ALL
write quite

Service ssh restart
/etc/init.d/ssh restart

Check again for root access. Got access.

Changing ssh port. Edit sshd_config file
vim /etc/ssh/sshd_confing
Port 22
change it to desired one

wq

service ssh restart

Check again with new port

ssh -p 220 testuser@SERVER_IP

Successfully logged in.

Restricting root user from direct login.
Edit sshd_config and add

PermitRootLogin no

and comment PermitRootLogin yes

service ssh restart



Now adding sftp users

create backup of sshd_config
Create new users with home directories
Create their passwords
Add it to group


Saturday, 14 December 2013

w3af not sending email , not even saving any configurations.


If w3af not saving any configurations then there is issue which can be resolved by recloaning w3af. And following instructions on console. Console might say to install phply. A command to install will also be there.

If w3af not sending email then make sure following.

Make sure mailutils and sendmail is installed.
Use sender domain.
Sender domain other than gmail. For example abc@yahoo.com.
Still not receiving email in gmail. Gmail might have black listed your ip. Change sender and receiver emails of yahoo domain.
Still having trouble.
Checking of logs is necessary.
/var/log/syslog
/var/log/mail.log