ostarine


 Powered by Max Banner Ads 

Mount unknown file system type NTFS CentOS

June 17th, 2016 by ayad

By default CentOS does not support the ‘NTFS’ file system, if you are tying to mount an NTFS file system  you will  need to have installed correct RPM package

#  wget  packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

# rpm -Uhv rpmforge-release-0.3.6-1.el5.rf.i386.rpm

warning: rpmforge-release-0.3.6-1.el5.rf.i386.rpm: Header V3 DSA signature: NOKEY, key ID 6b8d79e6
Preparing…        ########################################### [100%]
1:rpmforge-release  ########################################### [100%]

#  yum install fuse fuse-ntfs-3g dkms dkms-fuse

Make a directory for mount a file system to /mnt/usb

# mkdir /mnt/usb

# fdisk -l

Disk /dev/sda: 1999.8 GB, 1999844147200 bytes
255 heads, 63 sectors/track, 243133 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      514048+  83  Linux
/dev/sda5           14902       15921     8193118+  83  Linux
/dev/sda6           15922      243133  1825080358+  83  Linux

Disk /dev/sdb: 1000.2 GB, 1000204885504 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      121602   976759808    7  HPFS/NTFS

 

Execute the mount command

# mount -t ntfs-3g /dev/sdb1 /mnt/usb/

Open the mounted directory /mnt/usb

# cd /mnt/usb/

# ls -al
drwxr-xr-x 39 root root       4096 May 11 09:34 .
drwxr-xr-x  5 root root       4096 Jan 11 09:34 ..

Now the ntfs partition mounts perfect.

#  df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda6             1.1T  179G  880G  12% /
/dev/sda5             6.6G  146M  6.1G   2% /tmp
/dev/sda1             587M   43M  519M  10% /boot
/dev/sdb1             932G  781M  931G   1% /mnt/usb

You will need to unmount the partition,

umount /mnt/usb

references

http://thelinuxfaq.com/41-mount-unknown-file-system-type-ntfs-centos

OpenSSH Installations under CentOS Linux

March 31st, 2016 by ayad

OpenSSH Installations under CentOS Linux

To install the server and client type:

# yum -y install openssh-server openssh-clients

 

Start the service:

# chkconfig sshd on
# service sshd start

 

Make sure port 22 is opened:

netstat -tulpn | grep :22

 

Firewall Settings

Edit /etc/sysconfig/iptables (IPv4 firewall),

vi /etc/sysconfig/iptables

 

Add the line

-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 22 -j ACCEP

 

If you want to restict access to 192.168.1.0/24, edit it as follows:
-A RH-Firewall-1-INPUT -s 192.168.1.0/24 -m state --state NEW -p tcp --dport 22 -j ACCEPT

If your site uses IPv6, and you are editing ip6tables, use the line:
-A RH-Firewall-1-INPUT -m tcp -p tcp --dport 22 -j ACCEPT

 

Save and close the file. Restart iptables:
# service iptables restart

———————-

OpenSSH Server Configuration

Edit /etc/ssh/sshd_config, enter:
# vi /etc/ssh/sshd_config

To disable root logins, edit or add as follows:
PermitRootLogin no

 

Restrict login to user tom and jerry only over ssh:
AllowUsers tom jerry

Change ssh port i.e. run it on a non-standard port like 1235
Port 1235

Save and close the file. Restart sshd:
# service sshd restart

Change hostname for VPS in Virtuozzo hardware node

March 7th, 2016 by ayad

vzctl set VEID –hostname VEID.domain.local –save

 

 

Find and replace in Linux file

December 1st, 2015 by ayad

if in single file

sed -i ‘s/ugly/beautiful/g’ /home/bruno/old-friends/sue.txt

if in multiple files

$ find /home/bruno/old-friends -type f -exec sed -i ‘s/ugly/beautiful/g’ {} \;

 

Thanks.

 

To figure out how many CPU cores you have on your dedicated server

November 26th, 2015 by ayad

SSH to the server and run the following command

grep pro /proc/cpuinfo -c

 

Thanks.

Sync attack or DDOS prevention settings in CSF firewall

November 15th, 2015 by ayad

The two directives are PORTFLOOD and SYNFLOOD.
SYNFLOOD

SYNFLOOD is disabled by default. If you are not receiving any sort of attack, there is no need to enable it. If you are expecting an attack, enable it and set the rules a bit strict, like

SYNFLOOD = “1?

SYNFLOOD_RATE = “30/s”

SYNFLOOD_BURST = “10?

i.e. if 30 connections are received from an IP/sec for 10 times, block it. Make sure don’t keep it too strict if you are not receiving an attack else it will generate false positives and will block legit connections.
PORTFLOOD

PORTFLOOD = 80;tcp;100;5,22;tcp;5;300

ie, If an IP makes 100 connections in 5 sec to port 80 (tcp), then it will be blocked from the server and if 5 connections in 300 sec to 22 port.




The operation you were performing failed. You can retry the operation with or without changing its parameters. You may also want to report this problem to our support so that we could help you as soon as possible.

October 15th, 2015 by ayad

if you got the above error in plesk, you need to do the following steps to solve the issue

1- update windows

2- restart the server

3- run the following command

cd %plesk_bin%

ai.exe –select-product-id panel  –select-release-current –reinstall-patch –install-component base

 

Thanks.

Disable Leech protect on cpanel server to reduce mysql load

September 29th, 2015 by ayad

Doing the following seems gets rid of it until the next time cpanel is upgraded or until the next time apache is compiled.

Edit /var/cpanel/templates/apache2/main.default

Delete…

————

[% IF file_test('f', '/usr/local/cpanel/bin/leechprotect') -%]
RewriteEngine on
RewriteMap LeechProtect prg:/usr/local/cpanel/bin/leechprotect
RewriteLock /usr/local/apache/logs/rewrite_lock
[% END -%]
--------

Edit /usr/local/apache/conf/httpd.conf 

Delete ...
-----------
RewriteEngine on
RewriteMap LeechProtect prg:/usr/local/cpanel/bin/leechprotect
RewriteLock /usr/local/apache/logs/rewrite_lock
-----------

Kill the leachprotect process.


Run /usr/local/cpanel/bin/apache_conf_distiller --update

service httpd restart


stop and start rebuild software raid

September 29th, 2015 by ayad

mdadm /dev/md0 -f /dev/sda1                                  stop the rebuild
mdadm: set /dev/sda1 faulty in /dev/md0
mdadm /dev/md0 -r /dev/sda1                                  remove the devise to avoid start rebuild again after reboot
mdadm: hot removed /dev/sda1
mdadm /dev/md0 -a /dev/sda1                                     to start rebuild 
mdadm: hot added /dev/sda1

Hide home ip from header to avoid Spamhaus Policy Block List

September 14th, 2015 by ayad

in WHM -> Exim Configuration -> Advanced Editor

Add the following in the first box:

================================================================

received_header_text = Received: ${if def:sender_rcvhost {from ${if def:authenticated_id {localhost}{$sender_rcvhost}}\n\t}{${if def:sender_ident {from ${quote_local_part:$sender_ident} }}}}by $primary_hostname ${if def:received_protocol {with $received_protcol}} ${if def:tls_cipher {($tls_cipher)\n\t}}(Exim $version_number)\n\t${if def:sender_address {(envelope-from <$sender_address>)\n\t}}id $message_exim_id${if def:received_for {\n\tfor $received_for}}

 

================================================================

 

If the message is from an authenticated user, it will display “localhost” instead of the senders home ip address, thus resolving the issue.

Thanks.