2012/10/18

SSH in CentOS 6.3



SSH 安裝
#sudo yum  install openssh-server openssh-clients

SSH 開機時啟動
#sudo /sbin/chkconfig sshd on

SSH 啟動
#sudo /sbin/service sshd start

防火牆設定
#sudo vi /etc/sysconfig/iptables

添加下面一行(範例 port = 22)
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

重新啟動防火牆
#sudo /sbin/service iptables stop
#sudo /sbin/service iptables start

調整 SSH 設定
#vi  /etc/ssh/sshd_config

禁止 root 通過 SSH 登入
PermitRootLogin no

重新啟動

vsftpd 2.2 in CentOS 6.3


安裝 vsftpd
#yum install vsftpd


設定開機啟動 vsftpd ftp
#chkconfig vsftpd on

啟動服務
#service vsftpd start|restart|stop

修改 server port(注意防火牆設定是否完成)
#vi /etc/vsftpd/vsftpd.conf
在最後一行的地方加上: listen_port=21

新增 ftp 使用者
#vi /etc/vsftpd/vsftpd.conf 
拿掉以下兩個註解: 
chroot_list_enable=YES 
chroot_list_file=/etc/vsftpd.chroot_list 

增加使用者 ftpuser,指向路徑 /home/wwwroot/ftpuser, 禁止使用 SSH 權限 #useradd -d /home/wwwroot/ftpuser -g ftp -s /sbin/nologin ftpuser
(wwwroot需要先用 mkdir 的方式建立)

修改密碼
#passwd ftpuser

編輯文件chroot_list:
#vi /etc/vsftpd/chroot_list

內容為 ftp 帳號,每個帳號都佔一行:
jeff
nina
    登入 ftp 後可轉換至個人目錄
    #setsebool -P ftp_home_dir on

    配置防火牆
    編輯設置文件

    #vi /etc/sysconfig/iptables

    在REJECT行之前加上以下指令(範例是將 21 port 在防火牆開啟)
    -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT

    重新啟動防火牆
    #service iptables start



    2012/10/11

    Bluetooth Support Service Setting


    Bluetooth Support Service Setting

    Part 1 of the solution is buried in this Microsoft Knowledgebase article:
    And I quote:
    How to make sure that the Bluetooth service is started
    1. Open the Microsoft Management Console (MMC) snap-in for Services. To do this, follow these steps.

      Windows Vista or Windows 7
      1. Click StartVista Start Button, copy and then paste (or type) the following command in the Start Search box, and then press ENTER: services.msc
      2. In the Programs list, click Services.
        Security Shield
        If you are prompted for an administrator password or for confirmation, type the password, or click Continue.
      Windows XP
      1. Click Start, and then click Run.
      2. Copy and then paste (or type) the following command in the Open box, and then press ENTER: services.msc
    2. Double-click the Bluetooth Support service.
    3. If the Bluetooth Support service is stopped, click Start.
    4. On the Startup type list, click Automatic.
    5. Click the Log On tab.
    6. Click Local System account.
    7. Click OK.
    8. If you prompted to restart the computer, click Yes.
    My log on settings were okay, but my Startup Type was set to “Manual” rather than “Automatic”. I changed it, like so:
    Bluetooth Support Services Properties

    Bluetooth Power Management Setting

    But sadly, my problem wasn’t solved. So then I tried something else. I opened up Device Manager, expanded “Bluetooth Radios”, and double-clicked on the device to open its Properties page – not the enumerator, the device.
    Double click the device (highlighted), not the enumerator
    Double click the device (highlighted), not the enumerator
    Go to the Power Management page and clear the checkbox “Allow the computer to turn off this device to save power”. And finally, relief! No more disconnects. Apparently there is a bug in the power management of the Bluetooth driver under Windows 7.
    Uncheck 'Allow the computer to turn off this device to save power'
    Uncheck 'Allow the computer to turn off this device to save power'
    I can’t say for sure that the first step of making the Bluetooth Support Service automatic is necessary, or just turning off power management would fix it. It doesn’t hurt to change it to automatic so I didn’t test this. If you test it, post your results. Are both changes needed, or do you just need to turn off power management to stop losing connection?

    文章來自這裡

    NGINX SSL/設定檔案

    #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #...