2010年2月21日 星期日

pppoe server on linx

pppoe server on linx -- Opensuse 11

由於工作常需要 常用到很多種類伺服器服務來測試的關係故以 opensuse 11 架了個單純的 pppoe server 為了以後能更有利於測試,若是以後要加入 freeradius 搭配也能只改幾個設定就能拿來用,以下是安裝的環境及步驟:

Environment
OS:
opensuse 11
Kernel Version:
Linux 2.6.25.5-1.1-pae
Desktop environment:
KDE3.5 (KDM)
Network:
eth0:
inet 192.168.2.100
netmask 255.255.255.0
gateway 192.168.2.1

* 安裝相關套件如下

ppp
rp-pppoe
kinternet -- for client 端的 pppoe 軟體

* 確認 /etc/ppp 目錄中的檔案無誤,其中比較重要需要修改到的檔案已用紅色註記

# ls

chap-secrets
pap-secrets
options
pppoe-server-options
firewall-masq
ip-down.d
poll.tcpip
rp-pppoe-gui
connect-errors
firewall-standalone
ip-up
peers
filters
ip-down
ip-up.d
options.pptp
plugins
pppoe.conf

* 修改 options 如下

lock
crtscts
nobsdcomp
nodeflate
nopcomp

* 修改 pppoe-server-options 如下

auth
require-chap or require-pap --- 看您選擇那種認証方式來更改這個地方
default-mru
default-asyncmap
lcp-echo-interval 60
lcp-echo-failure 5
ms-dns 168.95.1.1
noipdefault
noipx
nodefaultroute
noproxyarp
noktune
10.0.0.1:10.0.0.200
netmask 255.255.255.255
logfile /var/log/pppd.log

* 若 pppoe-server-options 選擇 require-chap 則修改 chap-secrets 如下

#client hostname 192.168.1.1
bbb * 11111 *

* 若 pppoe-server-options 選擇 require-pap 則修改 pap-secrets 如下

#client hostname "password" 192.168.1.1
aaa * "111111" *

並且還需要更改您 client 端的 pppoe 撥號中的加密設定,下面這張圖是 vista 的範例



* 改完且設定後只需要執行下列這行指令即可啟動 pppoe server

#pppoe-server -I eth0 -L 192.168.2.100 -R 10.0.0.1 -N 128

-L 本機 IP address
-R 遠端發放的 IP 起始值
-N 最大同時連線數

想要知道更多 linux and freebsd 相關資料可以參考我的網頁
http://lifestory.moqin.com/

linux要如何知道目前檔案有幾個的指令

想請問linux要如何知道目前檔案有幾個的指令?

我用指令touch {report,memo,graph}_{sep,oct,nov,dec}_{a,b,c}_{1,2,3}
檔案有108個但我是一個一個算的,請問有指令可以知道檔案有幾個嗎?
我用wc -l 或awk 'END{print NR}'的指令都跑出109,但我算出是108沒錯啊!為什麼會多加1呢?
我跑去家目錄看一下檔案是9個,然後再用wc -l 或awk 'END{print NR}'也變成10!確定真的是多加1個,這是為什麼呢?

-------------------------------------------------------------------------
看目錄裡的檔案個數確實是用ls |wc ,您要不要確認一下是不是有目錄在裡面如果有目錄也會算一個喔

[NCLP] SLES 10 Administration (3072)

[NCLP] SLES 10 Administration (3072) 課程大綱

SUSE Linux Enterprise Server 10 Administration
Course 3072
Course Outline
This course covers the following topics:

Section 1: Install SUSE Linux Enterprise Server 10

Perform a SLES 10 Installation

Configure the SLES 10 Installation

Troubleshoot the Installation Process


Section 2: Administer the Linux File System

Select a Linux File System

Configure Linux File System Partitions

Manage Linux File Systems

Logical Volume Manager (LVM) and Software RAID

Set Up and Configure Disk Quotas


Section 3: Administer User Access and Security

Configure User Authentication with PAM

Manage and Secure the Linux User Environment

Use Access Control Lists (ACLs) for Advanced Access Control


Section 4: Configure the Network Manually

Understand Linux Network Terms

Set Up Network Interfaces With the ip Tool

Set Up Routing With the ip Tool

Test the Network Connection With Command Line Tools

Configure Host Name and Name Resolution

Use the NetworkManager to Configure the Network


Section 5: Administer Linux Processes and Services

View and Manage Processes

Schedule Jobs


Section 6: Monitor SUSE Linux Enterprise Server 10

Monitor a SUSE Linux Enterprise Server 10 System

Use System Logging Services

Monitor Login Activity


Section 7: Configure System Initialization

Describe the Linux Load Procedure

GRUB (Grand Unified Bootloader)

Manage Runlevels


Section 8: Manage Software for SUSE Linux Enterprise Server 10

Manage RPM Software Packages

Verify and Update Software Library Access


Section 9: Manage Backup and Recovery

Develop a Backup Strategy
Backup Files with YaST
Create Backups with tar
Work with Magnetic Tapes
Copy Data with dd
Mirror Directories with rsync
Automate Data Backups with cron

Section 10: Manage Printing
Configure Local Printing

Manage Print Jobs and Queues

Understand how CUPS Works

Configure and Manage a Print Server

Use the Web Interface to Manage a CUPS Server


Section 11: Configure Remote Access

Provide Secure Remote Access With OpenSSH

Enable Remote Administration With YaST

SLES 10 Fundamentals (3071)

[NCLP] SLES 10 Fundamentals (3071) 課程大綱

SUSE Linux Enterprise Server 10 Fundamentals
Course 3071
Course Outline
SECTION 1 - Understand the Linux Story

The History of Linux
The Historical Development of UNIX
The Development of Linux
The Software Differences Between SUSE Linux and SUSE Linux Enterprise Server
Understand the Multiuser Environment
Perform a Simple Installation of SUSE Linux Enterprise Server 10
Pre-Installation Requirements and Guidelines
Installation Options
Basic Installation
Configuration
SECTION 2 - Use the Linux Desktop

Overview of the Linux Desktop
Use the GNOME Desktop Environment
Log In
Log Out and Shutdown
Identify GNOME Desktop Components
Manage Icons in GNOME
Use the GNOME File Manager (Nautilus)
Access the Command Line Interface From the Desktop
 
SECTION 3 - Administer Linux with YaST

Get to Know YaST
Understand the Role of SuSEconfig
Manage the Network Configuration Information from YaST
Install Software Packages
Manage Installation Sources
SECTION 4 - Locate and Use Help Resources

Access and Use man Pages
Use info Pages
Access Release Notes and White Papers
Release Notes
Manuals
Help for Installed Packages
Howtos
Use GUI-Based Help
Find Help on the Web
SECTION 5 - Manage Directories and Files

Understand the File System Hierarchy Standard (FHS)
The Hierarchical Structure of the File System
FHS (Filesystem Hierarchy Standard)
Root Directory /
 
Essential Binaries for Use by All Users (/bin)
Boot Directory (/boot)
Other Partitions (/data)
Device Files (/dev)
Configuration Files (/etc)
User Directories (/home)
Libraries (/lib)
Mountpoints for Removable Media (/media/*)
Application Directory (/opt)
Home Directory of the Administrator (/root)
System Binaries (/sbin)
Data Directories for Services (/srv)
Subdomain for AppAmor (/subdomain)
Temporary Area (/tmp)
The Hierarchy Below /usr
Variable Files (/var)
Windows Partitions (/windows)
Process Files (/proc)
System Information Directory (/sys)
Mountpoint for Temporarily Mounted File Systems (/mnt)
Directories for Mounting Other File Systems
Identify File Types in the Linux System
Normal Files
Directories
Device Files
Links
Sockets
FIFOs
Change Directories and List Directory Contents
cd
ls
pwd
Create and View Files>
Create a New File with touch
View a File with cat
View a File with less
View a File with head and tail
Work with Files and Directories
Copy and Move Files and Directories
Create Directories
Delete Files and Directories
Link Files
Find Files on Linux
Graphical Search Tools
find
locate
whereis
which
type
Search File Content
How to Use the Command grep
How to Use Regular Expressions
SECTION 6 - Work With the Linux Shell and Command Line

Get to Know the Command Shells
Types of Shells
bash Configuration Files
Completion of Commands and File Names
Execute Commands at the Command Line
History Function
Switch to User root
Get to Know Common Command Line Tasks
Variables
Aliases
Understand Command Syntax and Special Characters
Select your Character Encoding
Name Expansion Using Search Patterns
Prevent the Shell from Interpreting Special Characters
Use Piping and Redirection
SECTION 7 - Use Linux Text Editors

Get to Know Linux Text Editors
Use the Editor vi to Edit Files
Start vi
Use the Editor vi
Learn the Working Modes
SECTION 8 - Manage User, Groups, and Permissions

Manage User and Group Accounts With YaST
Basics About Users and Groups
User and Group Administration With YaST
Describe Basic Linux User Security Features
File System Security Components
Users and Groups
Manage User and Group Accounts From the Command Line
Manage User Accounts From the Command Line
Manage Groups From the Command Line
Create Text Login Messages
Manage File Permissions and Ownership
Understand the File Permissions
Change the File Permissions With chmod
Change the File Ownership With chown and chgrp
Modify Default Access Permissions
Configure Special File Permissions
Ensure File System Security
The Basic Rule for User Write Access
The Basic Rule for User Read Access
How Special File Permissions Affect the Security of the System
APPENDIX A - Use the KDE Desktop Environment

Install the KDE Desktop Environment
Install KDE during the Installation of SUSE Linux Enterprise Server
Install KDE after the Installation of SUSE Linux Enterprise Server
Log In
Log Out and Shutdown
Identify KDE Desktop Components>/li>
The Desktop
The KDE Control Panel (Kicker)
The KDE Menu
Virtual Desktops
Manage Icons in the KDE Environment
Desktop
Kicker
KDE Menu
Use the Konqueror File Manager
APPENDIX B - Network Components and Architecture

Network Types
Client/Server and Peer-to-Peer Computing
Network Topology
Elements of a Network
TCP/IP Layer Model
想請問linux新增檔案指令的問題?

我想建立一個名叫com mander的檔案,但我打touch com mander,變成兩個檔案,請問要怎麼修改才能變成一個檔案呢?

Ans:
\> touch 'com mander'
用單引號就可以了!!

刪除 Linux的多重開機畫面

刪除 Linux的多重開機畫面。

當我們的電腦上同時安裝 Windows XP及 Linux時會使用 linux的 Grub當成多重開機的管理程式,但是有時我們有想把 Linux刪除時,那個Grub 多重開機的管理程式並沒有因為刪除了 Linux而消失,電腦開機後反而會卡在 Grub 那裏而不會自動找到存放 Windows XP的磁碟機來開機。

此時我們可以依下列步驟讓電腦能找到自動找到存放 Windows XP的磁碟機來開機,並且同把 Grub多重開機的管理程式刪除掉。

先把 Windows XP的原版光碟放入光碟機中後,讓電腦重新開機,我們就可以看到下列這個熟悉的 Windows XP安裝畫面,此時請按下「R」鍵,進入 Windows XP的 recovery console。



進入 Windows XP的 recovery console 後,依提示輸入「1」,按「enter」鍵。

再來 Windows XP會要求您輸入 administrator 的密碼,但工頭這裏沒有設定密碼,所以只要按一下「enter」鍵後就會看到下列這個畫面。



在 C:>WINDOWS > 提示文字之後,輸入 fixmbr 這個指令後,按「enter」鍵後就會看到下列這個畫面。



勇敢的輸入「y」後, 按「enter」鍵就完成了刪除 Linux的多重開機畫面的所有工作,請您取出光碟片並重新開機即可再次以看到 Windows XP 的開機畫面了。

ubuntu 6.10 desktop 中設定ADSL網路連線

在 ubuntu 6.10 desktop 中設定ADSL網路連線要使用下列方法才能過連上網際網路。

STEP 1:先點選螢幕桌面上方的選單來開啟下圖「終端機」的視窗︰
應用程式-> 附屬應用程式 -> 終端機
STEP 2:輸入以下指令來將設定ADSL網路連線的 PPP協定。
sudo pppoeconf
STEP 3:顯示 ubuntu 6.10 所找到的網路卡硬體。
STEP 4:輸入ADSL網路連線所要使用的帳號。
STEP 5:輸入ADSL網路連線所要使用的密碼。
STEP 6:看到以下這個畫面就代表設定ADSL網路連線的步驟己經完成了,我們可以使用下列指令去查詢連線是否正常。
plog
ifconfig ppp0