wget https://security.appspot.com/downloads/vsftpd-3.0.2.tar.gz
tar -zxvf vsftpd-3.0.2.tar.gz
yum -y install gcc openssl-devel libcap-devel tcp_wrappers-devel xinetd
cd vsftpd-3.0.2
sed -i 's/undef VSF_BUILD_TCPWRAPPERS/define VSF_BUILD_TCPWRAPPERS/g' builddefs.h
sed -i 's/undef VSF_BUILD_SSL/define VSF_BUILD_SSL/g' builddefs.h
make
ls -l vsftpd
mkdir /usr/share/empty/
mkdir /var/ftp/
mkdir /etc/vsftpd/
chown root.root /var/ftp
chmod og-w /var/ftp
make install
cp vsftpd.conf /etc/vsftpd
cp RedHat/vsftpd.pam /etc/pam.d/vsftpd
sed -i 's@file=/etc/ftpusers@file=/etc/vsftpd/ftpuser@g' /etc/pam.d/vsftpd

里歐 發表在 痞客邦 留言(0) 人氣()

wget https://github.com/downloads/libevent/libevent/libevent-2.0.20-stable.tar.gz
tar xzf libevent-2.0.20-stable.tar.gz
cd libevent-2.0.20-stable
./configure --prefix=/usr/local/libevent && make && sudo make install

里歐 發表在 痞客邦 留言(0) 人氣()

wget https://security.appspot.com/downloads/vsftpd-3.0.0.tar.gz
tar -zxvf vsftpd-3.0.0.tar.gz
yum -y install gcc openssl-devel
cd vsftpd-3.0.0
sed -i 's/undef VSF_BUILD_TCPWRAPPERS/define VSF_BUILD_TCPWRAPPERS/g' builddefs.h
sed -i 's/undef VSF_BUILD_SSL/define VSF_BUILD_SSL/g' builddefs.h
make
ls -l vsftpd
useradd nobody
mkdir /usr/share/empty/
mkdir /var/ftp/
mkdir /etc/vsftpd/
useradd -d /var/ftp ftp
chown root.root /var/ftp
chmod og-w /var/ftp
make install
cp vsftpd /usr/local/sbin/vsftpd
cp vsftpd.conf /etc/vsftpd
cp RedHat/vsftpd.pam /etc/pam.d/vsftpd
sed -i 's@file=/etc/ftpusers@file=/etc/vsftpd/ftpuser@g' /etc/pam.d/vsftpd

里歐 發表在 痞客邦 留言(0) 人氣()


安裝 ntp 伺服器
yum install ntp tzdata
chkconfig ntpd on


# ntp: 就是 NTP 伺服器的主要軟體啦,包括設定檔以及執行檔等等。

# tzdata: 軟體名稱為『 Time Zone data 』的縮寫,提供各時區對應的顯示格式。


 
編輯 /etc/ntp.conf:

# 拒絕 IPv4
restrict default kod nomodify notrap nopeer noquery
  
# 拒絕 IPv6
restrict -6 default kod nomodify notrap nopeer noquery
  
# 放行指定的主機,一般會填寫上層 NTP Server
restrict your.time.server
# 放行 tock.stdtime.gov.tw 進入本 NTP 伺服器
restrict 220.130.158.71
# 放行 tick.stdtime.gov.tw 進入本 NTP 伺服器
 restrict 59.124.196.83
# 放行 time.stdtime.gov.tw 進入本 NTP 伺服器
 restrict 59.124.196.84
  
# 預設放行本機
restrict 127.0.0.1
restrict -6 ::1
  
# 放行指定的私有網路主機  
restrict 192.168.100.0 mask 255.255.255.0 nomodify
# ignore: 拒絕所有類型的 NTP 連線;
# nomodify: 用戶端不能使用 ntpc 與 ntpq 這兩支程式來修改伺服器的時間參數, 但用戶端仍可透過這部主機來進行網路校時的;
# noquery: 用戶端不能夠使用 ntpq, ntpc 等指令來查詢時間伺服器,等於不提供 NTP 的網路校時囉;
# notrap: 不提供 trap 這個遠端事件登錄 (remote event logging) 的功能。
# notrust: 拒絕沒有認證的用戶端。

  
# 設定上層 NTP Server 
# 原本的 [0|1|2].centos.pool.ntp.org 的可以註解掉
server your.time.server
server 220.130.158.71 prefer  <==以這部主機為最優先
server 59.124.196.83
server 59.124.196.84


# 預設時間差異分析檔案與暫不用到的 keys 等
driftfile /var/lib/ntp/drift
keys      /etc/ntp/keys
參考網址 http://linux.vbird.org/linux_server/0440ntp.php
參考網址 http://www.brennan.id.au/09-Network_Time_Protocol.html

里歐 發表在 痞客邦 留言(0) 人氣()

Increasing Disk Space in CentOS using LVM
  

里歐 發表在 痞客邦 留言(0) 人氣()











Contents
1 - Summary
2 - Console set to secure
3 - Console set to insecure
1 - Summary
This guide will show how to reset the root password in case you forgot it.
This has been tested in Red Hat Enterprise Linux 4 and 5.
2 - Console set to secure
This method works where the console is set to secure in the /etc/inittab file
without the following line: ~~:S:wait:/sbin/sulogin. When booting into
single-user mode it doesn't prompt for the root password. If you use default
boot loader GRUB, press any key to enter the GRUB menu. Using the arrow keys
select the version of the kernel that you want to edit and press [e] to enter
into edit mode. Go to the end of the line and press space once then add the
word single to tell GRUB to boot into single-user mode. In Red Hat Enterprise
Linux 4 press [b] to boot while in Red Hat Enterprise Linux press [Enter] to
boot.
grub append> ro root=LABEL=/ rhgb quiet single
Reset the password for the root user.
sh-3.2# passwd root
Changing password for user root.
New UNIX password: ********
Retype new UNIX password: ********
passwd: all authentication tokens updated successfully.
Reboot the system and log in with the root account using the new password.
sh-3.2# shutdown -r now
3 - Console set to insecure
This method works where the console is set to insecure in the /etc/inittab file
with the following line: ~~:S:wait:/sbin/sulogin. When booting into single-user
mode it does prompt for the root password. Boot from the installation CD. In
Red Hat Enterprise Linux 4 you will need to type "linux rescue selinux=0" while
in Red Hat Enterprise Linux 5 type the following at the installation boot
prompt.
boot: linux rescue
Select a language at the Language menu and hit [Enter]. Select a keyboard at
the Keyboard Type menu and hit [Enter]. Select No at the Setup Networking
screen. Select Continue at the Rescue menu and hit [Enter]. The rescue
environment will try to find the Linux installation and mount it under the
directory /mnt/sysimage. The next screen lets you know if it was successful or
failed. Hit [Enter] to continue.
Get a list of the disks.
sh-3.2# fdisk -l | grep Disk
Disk /dev/hda: 80.0 GB, 80026361856 bytes
Get information about the hard disk.
sh-3.2# dmesg | grep hda:
<6> ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:DMA, hdb:DMA
<4>hda: WDC WD800BB-75CAA0, ATA DISK drive
<6>hda: max request size: 128KiB
<6>hda: Host Protected Area detected.
<6>hda: Host Protected Area disabled.
<6>hda: 156301488 sectors (80026 MB) w/2048KiB Cache, CHS=65535/16/63, UDMA(100)
<6>hda: cache flushes not supported
<6> hda: hda1 hda2 hda3
View information about the file systems.
sh-3.2# cat /mnt/sysimage/etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/data /data ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-hda3 swap swap defaults 0 0
Change the root directory to point to /mnt/sysimage and run the passwd command
for the root user.
sh-3.2# chroot /mnt/sysimage /usr/bin/passwd root
Changing password for root user.
New UNIX password: ********
Retype new UNIX password: ********
passwd: all authentication tokens updated successfully.
Reboot the system and login with the root account using the new password. Make
sure to remove the installation CD.
sh-3.2# exit




里歐 發表在 痞客邦 留言(0) 人氣()

*************************************************
******Download Postfix
*************************************************
mkdir postfix
cd postfix
wget ftp://ftp4.tnc.edu.tw/pub1/Postfix/official/postfix-2.7.0.tar.gz
wget ftp://ftp4.tnc.edu.tw/pub1/Postfix/official/postfix-2.7.0.tar.gz.sig
wget ftp://ftp4.tnc.edu.tw/pub1/Postfix/wietse.pgp

里歐 發表在 痞客邦 留言(0) 人氣()

尋找當下目錄裡*.jpg且大於1024k並執行ls -lh查看, 將最後結果導入ls_jpg.txt中.
find ./ -name "*.jpg" -size +1024k  -exec ls -lh {} \; > /root/ls_jpg.txt

里歐 發表在 痞客邦 留言(0) 人氣()

安裝及設定 vsftp on centos

安裝vsftp

  1. yum install vsftpd


設定iptables的ftp模組 [ vi /etc/sysconfig/iptables-config ]

  1. 修改參數 

    1. IPTABLES_MODULES="ip_conntrack_netbios_ns"
      修改成如下
      IPTABLES_MODULES="ip_conntrack_netbios_ns ip_conntrack_ftp"



設定iptables規則 [ vi /etc/sysconfig/iptables ]

  1.  新增參數

    1. -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT



設定selinux

  1. setsebool -P ftp_home_dir=1


新增本機帳戶使用者

  1. useradd leo


設定本機帳戶密碼

  1. passwd leo


里歐 發表在 痞客邦 留言(0) 人氣()

Prerequisites
net-snmp-devel

mysql

mysql-devel

openssl-devel

里歐 發表在 痞客邦 留言(0) 人氣()

 
 
 

里歐 發表在 痞客邦 留言(0) 人氣()

Wu-FTP Server 的安裝與設定
wu-ftp 是檔案傳輸服務程式FTP(File Trasfer Protocol),它是由美國華盛頓大學發展出來的,執行的效率與穩定性都相當好,可惜常常有一些安全上的漏洞,所以要常常注意它的最新消息。
在 RedHat 系統套件中,wu-ftp 最新版本為2.6.1,相關套件如下:

里歐 發表在 痞客邦 留言(0) 人氣()

1 2 3 4
Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。