o r g 1 1/37 Information technology faculty of Saigon University NGUYỄN THÀNH SƠN Chương 4 CÀI ĐẶT PHẦN MỀM VÀ KẾT NỐI MẠNG 3 tiết 2/37 Information technology faculty of Saigon Universit
Trang 1w
w
.
c
h
i
a
s
e
t
h
o
n
g
t
i
n
.
o
r
g
1
1/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
Chương 4
CÀI ĐẶT PHẦN MỀM VÀ
KẾT NỐI MẠNG
(3 tiết)
2/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
A CÀI ĐẶT PHẦN MỀM
3/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
Nội dung
4/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
I Giới thiệu RPM
name-version-release-architecture.rpm
Trang 2w
w
.
c
h
i
a
s
e
t
h
o
n
g
t
i
n
.
o
r
g
2
5/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
I Giới thiệu RPM (tt)
• CLI
6/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
II Sử dụng RPM
Lệnh rpm có nhiều tùy chọn
7/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
1 Cài đặt phần mềm
8/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
1 Cài đặt phần mềm
Lỗi thường gặp
• Ví dụ 1: #rpm -ivh mc-5.2.4-46.i386.rpm
mc package mc-5.2.4-46.i386.rpm is already installed
#rpm -ivh replacepkgs mc-5.2.4-46.i386.rpm
• Ví dụ 2: #rpm -ivh mc-5.2.4-46.i386.rpm
mc /usr/bin/mc conflicts with from bar-2.1-3
#rpm -ivh replacefiles mc-5.2.4-46.i386.rpm
• Ví dụ 3: #rpm -ivh bind-devel-8.4-0.i386.rpm
Failed dependecies: bind-8.2-2.i386.rpm
#rpm -ivh nodeps bind-devel-8.4-0.i386.rpm
Trang 3w
w
.
c
h
i
a
s
e
t
h
o
n
g
t
i
n
.
o
r
g
3
9/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
2 Gỡ bỏ
#rpm -evv tên_phần_mềm
Lỗi
Ví dụ:#rpm –e foo
Removing these packages would break dependencies: foo is needed by bar-1.0-1
10/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
3 Nâng cấp
Saving /etc/foo.conf as /etc/foo.conf.rpmsave
• Ví dụ:
#rpm -Uvh foo-2.0-1.i386.rpm
Foo package foo-2.0-1 (which is newer) is already
installed
#rpm -Uvh oldpackage foo-2.0-1.i386.rpm
11/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
4 Vấn tin
mc-5.2.4-46
12/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
5 Thẩm tra
quyền hạn, loại tập tin, người sở hữu, nhóm sở hữu tập tin
Trang 4w
w
.
c
h
i
a
s
e
t
h
o
n
g
t
i
n
.
o
r
g
4
13/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
5 Thẩm tra (tt)
Thông báo lỗi
Định dạng thông báo gồm:
• 8 kí tự tên tập tin.
• Dấu (.)
• Kí tự đại diện cho các lỗi kiểm tra:
+ S: size
+ M: quyền, loại
+ 5: MD5 checksum
+ D: device
+ L : link
+ U: user
+ G: group
+ T : time
+ ?: no exist
14/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
III Phần mềm không đóng gói
15/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
III Phần mềm không đóng gói
(tt)
16/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
B KẾT NỐI MẠNG
Trang 5w
w
.
c
h
i
a
s
e
t
h
o
n
g
t
i
n
.
o
r
g
5
17/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
Nội dung
18/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
I TCP/IP trong Linux
Protocol
oriented-connection
19/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
I TCP/IP trong Linux (tt)
Switch, Repeater, Router
20/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
I TCP/IP trong Linux (tt)
hành, sửa đổi sau cài đặt:
Trang 6w
w
.
c
h
i
a
s
e
t
h
o
n
g
t
i
n
.
o
r
g
6
21/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
II Công cụ đồ họa
22/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
1 Tiện ích setup
set up networking?”, chọn “Yes”.
23/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
1 Tiện ích setup (tt)
24/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
2 Tiện ích linuxconf
Trang 7w
w
.
c
h
i
a
s
e
t
h
o
n
g
t
i
n
.
o
r
g
7
25/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
2 Tiện ích linuxconf (tt)
26/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
Đáp ứng mọi thao tác cấu hình:
III Công cụ dòng lệnh
27/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
1 Lệnh ifconfig
#ifconfig [tùy_chọn] [tên_card_mạng]
[địa_chỉ_IP] [netmask mặt_nạ]
28/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
1 Lệnh ifconfig (tt1)
Tính năng thường dùng:
thống (xem hình trang sau)
Trang 8w
w
.
c
h
i
a
s
e
t
h
o
n
g
t
i
n
.
o
r
g
8
29/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
1 Lệnh ifconfig (tt2)
30/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
2 Lệnh route
#route [tùy_chọn] [-net] [IP_mạng_đích]
[netmask Nm] [gw Gw]
31/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
2 Lệnh route (tt)
Destination Gateway Genmask Flags Metric Ref Use Iface 10.168.98.0 * 255.255.255.0 U 0 0 0 eth0 127.0.0.0 * 255.0.0.0 U 0 0 0 lo default 10.168.1.1 0.0.0.0 UG 0 0 0 eth0
32/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
IV Tập tin cấu hình
/etc/hosts 192.168.98.100 ln003 localhost.localdomain localhost
/etc/services Tcpmux 1/tcp #TCP port service multiplexer
/etc/resolv.conf
/etc/sysconfig/network NETWORKING=yes HOSTNAME=ln003 GATEWAY=192.168.98.1
/etc/sysconfig/network-scripts/ifcfg-ethx DEVICE=eth0
ONBOOT=yes BOOPROTO=static IPADDR=192.168.1.100 NETMASK=255.255.255.0 GATEWAY=192.168.1.1
Trang 9w
w
.
c
h
i
a
s
e
t
h
o
n
g
t
i
n
.
o
r
g
9
33/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
V Các lệnh liên quan
Lệnh hostname
• Công dụng
• Cú pháp: #hostname [newhostname]
• Ví dụ: #hostname server01
• Ý nghĩa tác dụng
Lệnh netstat
• Công dụng
• Cú pháp: #netstat [tùy_chọn]
• Thường sử dụng:
+ Xem bảng định tuyến
+ Kiểm tra tất cả
Lệnh ping
34/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
VI Tiện ích Telnet
+ /etc/xinetd.d/telnet sửa Disable=no
+ #/etc/init.d/xinetd restart
35/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
VII Tiện ích SSH
• SSH server:
+ Vị trí cài đặt
+ Lệnh: #rpm –ivh openssh-server-package.rpm
+ /etc/ssh/sshd_config và /etc/ssh/ssh_config
+ #/etc/init.d/sshd [tùy_chọn]
• SSH client:
+ Vị trí cài đặt
+ Lệnh: #rpm –ivh openssh-client-package.rpm
36/37
Information technology faculty of Saigon University NGUYỄN THÀNH SƠN
Tóm tắt
Khái niệm RPM
Chức năng chính RPM
• Cài đặt
• Gỡ bỏ
• Nâng cấp
Phân biệt các dạng đóng gói
Phần mềm không đóng gói
Thuật ngữ trong TCP/IP
Thao tác cấu hình mạng bằng lệnh: ifconfig, route
Tập tin cấu hình: host, ifcfg-ethx
Tiện ích truy xuất từ xa: telnet, ssh
Trang 10w
w
.
c
h
i
a
s
e
t
h
o
n
g
t
i
n
.
o
r
g
10
NGUYỄN THÀNH SƠN