책에 나와있는 거의 모든 실습을 진행해 보았는데 리눅스 초급 사용자라면 가상머신에서 효과적으로 실습을 할 수 있을 만한 책이다.
간혹 책에서 예시한 것과 같이 설치를 진행하더라도 에러가 발생하는 경우가 있는데
초급 사용자가 인터넷 구글링을 하면서 찾는다면 좀더 효율적으로 학습하는 효과가 있을 것으로 생각된다.
1. poweroff, shutdown, halt, init
shutdown -P +10
shutdown -c
shutdown -k +15
shutdown -H (halt)
shutdown -h (poweroff)
halt -p
init 0
2. reboot, init 6
shutdown -r now
shutdown -r 22:00
3. logout, exit
4. Ctrl+Alt+F1, F2, F3, F4, F5, F6 (가상 콘솔)
5. run leve
0, 1, 3, 5, 6
ls -l /lib/systemd/system/runlevel*.target
/etc/systemd/system/default.target이 /lib/systemd/system/graphical.target에 링크되어 있음
이 링크를 변경하면 부팅 후에 다른 레벨로 변경 가능
startx
6. Tab, 위/아래 화살표
history -c
history
7. editer
nano, gedit, vi
vi 편집기 비정상 종료시에 swap 파일 생성
i, I
a, A
o, O
s, S
h, j, k, l
Ctrl+f, Ctrl+b
^, $
gg, GG
숫자g
x
dd, 숫자dd
yy, 숫자yy
p, P
/문자열, n
:%s/기존문자열/
:set number
8. man
1~9세션으로 구성
man 세션 명령어
man 1 cd
9. mount, unmount
rpm -qa
yum
genisoimage -r -J -o 생성될ISO 포함할파일/디렉토리
mount -o loop test.iso /media/iso
10. ls
11. cd
cd ~사용자명
12. pwd
13. rm
14. cp
15. touch
16. mv
17. mkdir
mkdir -p
18. rmdir
19. cat
20. head, tail
21. more
more +100 test.txt
22. less
less +100 test.txt
23. file
24. clear
25. user, group
/etc/passwd
/etc/group
/etc/shadow
useradd
passwd
usermod
usermod -g (다른 그룹으로 변경)
usermod -G (새로운 그룹을 추가)
userdel
chage
groupadd
groupmod
groupdel
gpasswd
/etc/skel -> /home/사용자/
system-config-users
26.
d, -, b, c, l
chmod 777
chmod u+rwx
chown
chgrp
chown test.test abcd
27.ln, ln -s
28. rpm
~.rpm
rpm -Uvh ~.rpm
rpm -e
rpm -qa
rpm -qf
rpm -ql
rpm -qi
rpm -qip
rpm -qlp
29. yum
rpm의 패키지 의존성 문제 해결
yum -y install
yum localinstall
yum check-update
yum update
yum remove
yum info
yum groupinstall
yum list
yum provides
yum install --nogpgcheck
yum clean all
/etc/yum.conf
/etc/yum.repos.d/
gpg(Gnu Privacy Guard)
30. 압축, 묶기
xz, bzip2, bunzip2, gzip, gunzip, zip, unzip
tar
31. 파일 위치 검색
find, which, whereis, locate (updatedb)
find /var -name "*.swp" -exec rm {} \;
32. 시스템 설정(X 윈도우)
system-config-date
nmtui
firewall-config
ntsysv
system-config-keyboard
system-config-language
system-config-printer
system-config-users
system-config-kickstart
33. cron, at
crond
/etc/crontab
분 시 일 월 요일 사용자 실행명령
0~59, 0~23, 1~31, 1~12, 0~6 (0=일요일)
rdate -s time.bora.net
34.
systemctl start/stop/restart/status/enable/disable network(서비스이름)
ifup
ifdown
ifconfig
nslookup
ping
/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-인터페이스이름
/etc/resolv.conf
/etc/hosts
35. SELinux(Security Enhanced Linux)
/etc/sysconfig/selinux
system-config-selinux
36. |, grep, tail, wc, sort, awk, sed >, >>, <
37. ps, kill, bg, jobs, fg, command &
38. init, systemd
systemctl start httpd
systemctl list-unit-files & system-config-services
39. GRUB
/etc/default/grub, /etc/grub.d/
grub2-mkconfig -o ~위의설정파일
grub에 ID, Password 설정하기
/etc/grub.d/00_header
cat << EOF
set superusers="grubuser"
password grubuser 1234
EOF
40. Kernel Compile
uname -r
cd /usr/src /root/다운로드/linux-3.17.4.tar.xz
tar xvfJ linux-3.17.4.tar.xz
cd linux-3.17.4
make mrproper
make xconfig
make clean
make (컴파일)
make modules_install (컴파일된 모듈을 /lib/modules/에 설치)
make install (컴파일된 커널을 /boot에 설치, grub2에 등록)
ls -l /boot
cat /etc/grub2/grub.cfg
41. Hard Disk add
fdisk /dev/sdb
mkfs.ext4 /dev/sdb1
mkdir /mydata
mount /dev/sdb1 /mydata
/etc/fstab
dump 사용여부, 파일시스템 체크여부
42. RAID
Linear RAID, RAID 0, RAID 1, RAID 5, RAID 6, RAID 1+0
RAID 0 Stripping 방식
mdadm
[Linear RAID]
mdadm --create /dev/md9 --level=linear --raid-devices=2 /dev/sdb1 /dev/sdc1
mdadm -C /dev/md9 -l l -n 2 /dev/sdb1 /dev/sdc1
[RAID 0]
mdadm --create /dev/md0 --level=0 --raid-devices=2 /dev/sdb1 /dev/sdc1
[RAID 1]
mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1
[RAID 5]
mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1
[RAID 6]
mdadm --create /dev/md0 --level=6 --raid-devices=4 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1
[RAID 1+0]
mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1
mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sdd1 /dev/sde1
mdadm --create /dev/md10 --level=0 --raid-devices=2 /dev/md1 /dev/md2
mdadm --detail /dev/md9
mdadm --stop /dev/md9
mdadm --run /dev/md1
mdadm /dev/md1 --add /dev/sdg1
43. LVM(Logica Volume Manager)
물리볼륨
볼륨그룹
논리볼륨
pvcreate /dev/sdb
pvcreate /dev/sdc
pvcreate /dev/sdd
pvscan
pvdisplay
vgcreate VG_1 /dev/sdb /dev/sdc
vgdisplay
vgchange -a y VG_1
vgextend VG_1 /dev/sdd
vgreduce VG_1 /dev/sdd
pvmove /dev/sdd
vgchange -a n VG_1
vgremove VG_1
pvremove /dev/sdb /dev/sdc /dev/sdd
lvcreate --size 1G --name LV_1 VG_1
lvcreate --size 3G --name LV_2 VG_1
lvcreate --extents 100%FREE --name LV_3 VG_1
lvscan
lvdisplay
mkfs -f ext4 /dev/VG_1/LV_1
mkfs -f ext4 /dev/VG_2/LV_1
mkfs -f ext4 /dev/VG_3/LV_1
lvextend
lvreduce
lvremove
44. Quota
vi /etc/fstab
/dev/sdb1/home ext4 defaults,usrquota 1 2
quotacheck -augmn
touch aquota.user aquota.group
chmod 600 aquota.*
quotacheck -augmn
quotaon -avug
edquota -u 사용자 or 그룹
edquota -p 기존사용자 대상사용자
repquota -a
repquota /home
quota -v nestgoer
quota
vi /root/crons/quotachk.sh
#!/bin/bash
/sbin/quotaoff -auvg
/sbin/quotacheck -auvg
/sbin/quotaon -auvg
crontab -e
# quota weekly check
0 5 * * 1 /root/crons/quotachk.sh
crontab -l
vi /etc/warnquota.conf
45. VNC
yum -y install telnet-server
systemctl start telnet.socket
systemctl status telnet.socket
yum -y install telnet
firewall-cmd --permanent --add-service=telnet
firewall-cmd --permanent --add-port=23/tcp
/etc/securetty
46. VNC
yum check-update
yum groupinstall "GNOME Desktop"
unlink /etc/systemd/system/default.target
ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
reboot
yum install tigervnc-server xorg-x11-fonts-Type1 -y
cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
nano /etc/systemd/system/vncserver@:1.service
Find these lines:
ExecStart=/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"
PIDFile=/home/<USER>/.vnc/%H%i.pid
<USER> 부분을 VNC 사용자 ID로 변경
systemctl daemon-reload
vncpasswd 사용자ID
systemctl enable vncserver@:1.service
systemctl start vncserver@:1.service
firewall-cmd --permanent --add-service vnc-server
# systemctl restart firewalld.service
vncviewer 192.168.10.125:1
47. DNS
/etc/host.conf
multi on
order hosts, bind
order bind, hosts
/etc/hosts
nameserver 168.126.63.1
yum -y install bind bind-chroot
firewall-config
dig @192.168.10.125 www.naver.com
nslookup - 192.168.10.125
/etc/named.conf
zone "kairos.com" In {
type master;
file "kairos.com.db";
allow-update { none; };
};
named-checkconf
/var/named/kairos.com.db
;
$TTL 3H
@ IN SOA {
1034 ; serial no
360000 ; refresh
3600 ; retry
3600000 ; expire
3600 ; default ttl
}
IN NS @
IN A 192.168.10.125
ftp 10 IN A 192.168.10.125
20 IN A 192.168.10.126
30 IN A 192.168.10.127
www IN A 192.168.10.125
IN A 192.168.10.126
named-checkzone kairos.com kairos.com.db
48. mail
yum -y install sendmail
/etc/hostname
localhost.localdomain => mail.kairos.com
/etc/hosts
192.168.10.125 mail.kairos.com
/etc/mail/local-host-names
mail.kairos.com
/etc/sysconfig/network
HOSTNAME=mail.kairos.com
/etc/dovecot/dovecot.con
protocols
listen
base_dir
/etc/dovecot/conf.d/10-ssl.conf
ssl
/etc/dovecot/conf.d/10-mail.conf
mail_location
mail_access_groups
lock_method
systemctl restart sendmail
systemctl enable sendmail
systemctl status sendmail
systemctl restart dovecot
systemctl enable dovecot
systemctl status dovecot
netstat -ant
yum -y install evolution
49. Squirrelmail
50. DB
MariaDB(Mysql)
mariadb.org
Mairdb Download
MariaDB Client
MariaDB Common
MariaDB Server
galera
jemalloc
yum -y remove mariadb-libs (MariaDB Common 설치 시에 MariaDB libs와 충돌)
yum -y localinstall Maria*
systemctl restart mysql
systemctl status mysql
chkconfig mysql on
mysqladmin -u root password '1234'
oracle
Client= SQLPLUS 설치
Go to http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html to download the oracle Linux x86-64 instant clients
Download the matching client
oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm
oracle-instantclient11.2-sqlplus-11.2.0.2.0.x86_64.rpm
Install
rpm -ivh oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm
rpm -ivh oracle-instantclient11.2-sqlplus-11.2.0.2.0.x86_64.rpm
Set environment variables in your ~/.bash_profile
ORACLE_HOME=/usr/lib/oracle/11.2/client64
PATH=$ORACLE_HOME/bin:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_HOME
export LD_LIBRARY_PATH
export PATH
SQLPLUS 시작
51. Web Server
1) XE(XpressEngine)
selinux disable
mysql root 패스워드 입력하지 않고 설치
yum -y install php. gd, php-gd, xml-common
/etc/httpd/conf/httpd.conf
<Directory "/var/www/html">
AllowOverride None ==> All
<Directory>
XE 다운로드
/var/www/html로 복사
chmod 707 xe
mysql
grant all privileges on xeDB.* to xeUser@localhost identified by '1234';
mysql -u xeUser -p1234
create database xeDB
XE 설정
디렉토리 퍼미션 오류 시(707)
xe 밑의 전체 파일 퍼미션 조정
chmod -R 707 ./xe
chown -R apache.apache ./xe
DB 사용 불가능 시
yum -y skip-broken install php-*
yum -y install epel-release
yum -y install php-mcrypt
systemctl restart httpd
"rewrite mod가 필요합니다."
/etc/httpd/conf/httpd.conf
AllowOverride의 None을 All로
systemctl restart httpd
웹하드
AjaXplorer 설치
/var/www/html 밑에 webhard에 복사
chmod -R 707 webhard
chown -R apache.apache webhard
yum -y --skip-broken install php-*
yum -y install epel-release
yum -y install php-mcrypt
/etc/httpd/conf/httpd.conf
AllowOverride None ==> All
systemctl restart httpd
기타 웹 하드 설정
클라우드 서비스
ownCloud 설치
52. vsftpd
yum -y install vsftpd
/etc/vsftpd/vsftpd.conf
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
ftpd_banner= 환영!! CentOS 7 FTP Server
systemctl restart vsftpd
53. nfs
54. Samba
samba client
sambaclient -L 192.168.10.125
samba server
samba
system-config-samba
55. dhcp
/etc/dhcp/dhcpd.conf
/var/lib/dhcpd/dhcpd.leases
systemctl restart dhcpd
56. proxy
squid
57. firewall
58. pxe installation server
(preboot execution environment)
dhcp server, tftp server, ftp/web server
syslinux boot file
kickstart
댓글