Showing posts with label solution. Show all posts
Showing posts with label solution. Show all posts

Sunday, April 7, 2013

Linux adduser user@domain.tld with @ or . inside the userid and use it as an FTP account





If you want to add a new user to your linux box and it not contains any special char like an '@' or '.' there is no problem. In the other case you could not find an answer simply googling around. For this reason i have to make some tests on different kind of server (dedicated and vps ones). 

Via plesk or others gui i didn't find a way to add user with special chars inside the username, also via shell i had some problems with that. 

The final solution for me was using webmin or follow the instructions below:

# groupadd ftpusers
# adduser 1234455 -d /home/1234455 -G ftpusers
# passwd 1234455
# type and retype password
# chown 1234455:ftpusers /home/1234455/

Well, now you have a user without @extdomain.tld so to do that you have to modify two files:

/etc/passwd
/etc/shadow

edit in passwd:

old one
1234455:x:10005:505::/home/1234455:/bin/false
new one
1234455@extdomain.tld:x:10005:505::/home/1234455:/bin/false

edit the same in the shadow and be carefull when do that.

After doing these hacks you could access to your home directory via ftp using 1234455@extdomain.tld :)








Read more...

Tuesday, November 8, 2011

[solved] MYSQL Can't start server: can't create PID file: No space left on device



Hi all dear friends of HTV, today i will explain how to fix a bug that affects MySQL server running on a Centos 5.0 Box.

The error in the /var/log/mysqld is :

Can't start server: can't create PID file: No space left on device MYSQL

If your MySQL can't restart and the /var/log/mysqld log show you this message, well, most probably you finished your partition space available.

To solve this issue you have to do the following steps:

1) check your partitions with the command:

df -h

this command will output your partitions conf:

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              58G   53G   0  100% //dev/sda1              99M   12M   83M  13% /boot
/dev/sda2              58G   13G   42G  24% /media/sda2



Please notice that the full size of /dev/sda2 partition is 58GB, the used space is 53GB and the available once is 0 (100% use).


2) Now that we are aware of this we have to find the files (often they are huge log files) that fill our partition. So we could take a look in the /var directory or /tmp directory to find and move some of them via rsync into another partition or we could free some space deleting older logs and files not needed. (Be carefully when you are doing that).
To find big files over your system you could execute this command via ssh


 du -h --max-depth=3 /* > mybigfiles.txt


This command will write in the file all the output of the command du -h -max-depth=3 in the file named mybigfiles.txt all showing all the dirs in the system with theirs current size.

Navigating through this file you could find which directories are the biggest ones and after that you have to clean them before restarting MySQL server.

First of all do this command via cmd line:

yum clean all

To empty cached sources and packages in your RH distro.

Then if you would like to remove, for example, all the log files in a dir older then 3 days you have to execute the command :


find /var/log/mydirectorywithbigfiles -type f -mtime +3 -exec rm {}


or use this bash script


#!/bin/bash

find /var/log/mydirectorywithbigfiles -type f -mtime +3 -exec rm {} \;

  

that use a combo of find command and -exec rm {} that removes all the files inside that dir.

After that please execute again the command to check if you freed up some disk space.


df -h

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              58G   13G   42G  24% //dev/sda1              99M   12M   83M  13% /boot
/dev/sda2              58G   13G   42G  24% /media/sda2



Once finished, please restart your Mysqld daemon, via /etc/init.d/mysqld start.


Leave a comment if you liked this guide.


HTV





Read more...

Saturday, May 3, 2008

Hacking with Remote file inclusion vulnerability and a way to patch it

This video demonstrates how an RFI (remote file inclusion) works and explain how you could patch a vulnerability like this in you PHP web application.
There are a lot of way to sanitize your get and posted variables.
This is one of them.



PHP RFI Solution... - A funny movie is a click away


Read more...