Presentation is loading. Please wait.

Presentation is loading. Please wait.

20. 시스템 관리. 수퍼 유저(The Superuser) 시스템 구성(System Configuration)

Similar presentations


Presentation on theme: "20. 시스템 관리. 수퍼 유저(The Superuser) 시스템 구성(System Configuration)"— Presentation transcript:

1 20. 시스템 관리. 수퍼 유저(The Superuser) 시스템 구성(System Configuration)
date 명령으로 날짜와 시간 지정 모든 파일 접근 및 접근 권한 지정 원격 파일 시스템은 제외 수퍼 유저 되기 root로 로그인 su 명령 $ su - Passwd: $ su Ctrl-D 시스템 구성(System Configuration) h/w 설치 s/w 설치 장치 드라이버 추가 장치의 로드 가능 드라이브를 적절한 /kernel 서브디렉토리에 복사하고 /etc/system에 기록한 후 재부팅 커널 설치 영역 보통: /unix /vmunix Solaris: /kernel Solaris /kernel $ ls -F drv/ exec/ fs/ genunix* misc/ sched/ strmod/ sys/ drv: 장치드라이버와 설정 파일을 위한 로드 가능한 객체들 exec: 목적 파일을 인식할 수 있는 로드 가능한 객체들 fs:파일 시스템을 관리를 위한 로드 가능한 객체들 misc:기타 커널 루틴을 위한 로드 가능한 객체들 sched:프로세스 스케줄링 모듈들 strmod: STREAMS 모듈들 sys: 커널 시스템의 다양한 옵션들 genunix: base kernel 자신 특수 장치 파일 major 번호, minor 번호 /dev 에 특수 파일 생성 Unix

2 20. 시스템 관리.. 사용자 계정 관리 수작업으로 사용자 계정 추가 /etc/shadow /etc/passwd
admintool 수동 수작업으로 사용자 계정 추가 시스템 관리자 사용자 계정 정의위해 /etc/passwd 파일을 편집한다. 초기 패스워드 설정위해 vipw로 /etc/shadow 파일을 편집한다. 사용자의 홈 디렉토리를 생성한다. 그 사용자를 /etc/group 파일에 첨가한다. 사용자 사용자의 홈디렉토리에 초기 파일들(.cshrc 등)을 복사한다. 사용자의 메일 홈과 메일 별명(alias)를 설정한다. /etc/shadow root:XDRChkYLiPApM:10837:::::: daemon:NP:6445:::::: mysung:nk9q4P1tl3DVw:10879:::::: /etc/passwd 사용자의 로그인 명 암호화된 사용자의 암호 Unix 사용자 ID 번호(UID) (0~65535) 사용자의 Unix 그룹 ID 번호(GID) 사용자의 완전한 이름 또는 설명 사용자의 홈 디렉토리 사용자의 로그인 쉘 root:x:0:1:Super-User:/:/bin/csh daemon:x:1:1::/: ... project:x:2004:2000::/home/project:/bin/csh Crypt algorithm 64-bit block of encrypted text zero + passwd -> crypt algorithm(salt 포함) 25회 반복 -> 11문자로 unpack + 2문자 salt (처음 2문자) salt : 날짜와 시간에 따라 정의됨 (예) passwd salt encrypted passwd xxxxxxxx nk nk9q4P1t13DVw Unix

3 20. 시스템 관리... 사용자 계정 삭제 수동으로 사용자 계정 삭제 파일 시스템 디스크 드라이브 확인 admintool 이용
/etc/passwd 안의 엔트리 삭제 /etc/group 안의 엔트리 삭제 전자 메일 스풀 파일 삭제 파일 시스템 Solaris 2.7의 최대 파일 크기 조사! 디스크 파티션(슬라이스) : 최대 8개(0-7) 0 : / (루트 시스템 파일) 1 : swap (스왑 영역) 2 : (전체 디스크) 3 ~6 : 운영체제 파일 4 : /var (스풀, 로그 등 여러가지) 5 : /opt (선택적 소프트웨어) 6 : /usr (사용자 시스템 파일) 7 : /home (사용자 데이터 파일) 디스크 드라이브 확인 # dmesg | more 파티션 하는 이유 (format 명령으로) 기능적으로 데이터를 조직 수퍼유저의 백업 정책 수립에 도움 신뢰성 파일 시스템 구축 newfs : construct a new UFS file system (mkfs 이용) 기존 데이터 지우고 I-node 공간 할당 lost+found 디렉토리 설치 # newfs /dev/rdsk/c0t0d0s0 mkfs : construct a file system 파일 시스템 설치 파티션 상의 정보는 mount 명령으로 커널이 그 존재를 알고 난 후에만 사용 가능 mount : 접근 가능한 파일 시스템 구조에 포함 시킴 읽기/쓰기 또는 읽기 전용 가능 umount : 접근 가능한 파일 시스템 구조에 포함되지 않게 함 Unix

4 20. 시스템 관리…. 파일 시스템 해제 파일 시스템 일관성 검사 논리적 해제: umount 물리적 해제:매체 제거
sync : 디스크 정보 동기화 버퍼 안의 내용을 물리 매체로 옮김 shutdown 수행 전에 반드시 실행(fsck의 루트 파일 시스템 오류 복구 제외) fsck(for file system consistency check) : 손상된 파일 출력 I-node 정보로 파일 크기 조사 하나 이상의 파일이 참조하는 블록 조사 디렉토리 구조 검사 파일 참조 개수와 I-node의 참조 개수 조사 free block list 검사 # fsck /dev/dsk/c0t0d0s0 ** /dev/dsk/c0t0d0s0 ** Currently Mounted on / ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity ** Phase 4 - Check Reference Counts ** Phase 5 - Check Cyl groups 1340 files, used, free (248 frags, blocks, 0.0% fragmentation) 파일과 파일명 파일명은 디렉토리에 파일 정보는 I-node에 orphaned files: 파일명 없는 파일 :fsck가 lost+found 디렉토리에 저장 Unix

5 20. 시스템 관리….. 루트 파일 시스템 네트워크 파일 시스템 파일 시스템 테이블 파일 시스템 타입 umount 불가
읽기 전용 불가 표준 디렉토리 자료 참조 네트워크 파일 시스템 NFS(Network File System) 서버 : /etc/dfs/dfstab 클라이언트 : /etc/vfstab RFS(Remote File System) diskless workstation 불가능 원격 특수 파일 설치 가능 파일 시스템 테이블 /etc/vfstab (이전에는 /etc/fstab) : 다중 사용자 부팅시 자동 설치될 모든 파일 시스템 리스트 /etc/mnttab: 설치된 파일 시스템 리스트 파일 시스템 타입 vfs : Virtual File System ufs : Unix File System nfs : Network File System hsfs : High Sierra File System(standard CD ROM File System) lofs : Lookback File System pcfs : DOS File System Mountable on Unix Unix

6 부팅(Booting): Unix 커널이 루트 파일 시스템에서 메모리로 로드 되는 것
20. 시스템 관리:. 부팅(Booting): Unix 커널이 루트 파일 시스템에서 메모리로 로드 되는 것 system 부팅 절차 부트 프로그램 단계: boot PROM이 부트스트랩 프로그램bootblk(sectors 1-15) 로드 /platform/`uname -i`/ufsboot 로드 (SUNW,SPARCserver > sun4d) /platform /`uname -i`/ kernel/unix 로드 /kernel/genunix (generic kernel) 로드 커널 초기화 단계 프로세스 0 생성: 사용자 테이블 할당, 프로세스 테이블 첫번 항목 초기화 fork()로 프로세스 1 생성 brk()로 코드 크기 확장 코드 영역 생성 -> exec /sbin/init /sbin/init 실행 단계 디폴트 실행 레블 제공하는 프로세스 생성 /etc/initab 읽어 실행 상태 전환 실행 레벨 : default=3 0 : PROM monitor level 1 : Administrative state(single-user mode with some file systems mounted and user logins disabled) 2 : Multiuser level(with no resources shared) 3 : Multiuser level(with resources shared) 4 : Not currently used 5 : Halt 6 : Reboot ro default run level 3 S,s : Single-user mode with some file systems mounted and user logins disabled /etc/inittab: 실행 레벨별 초기상태 정의 s2:23:wait:/sbin/rc2 >/dev/console 2<>/dev/console </dev/console /sbin/rc# 스크립트 /etc/rc#.d (예, /etc/rc2.d) 파일 실행 init # (init 5) : 재부팅 않고 실행 레벨 이동 shutdown -i5 booting시 Ctrl-D 하고 run level 입력 Unix

7 20. 시스템 관리:.. 시스템 셧다운 백업(또는 덤프) 스와핑(Swapping)과 스티키(Sticky) 모드
shutdown 명령 또는 sync 명령 + halt 명령 백업(또는 덤프) 백업과 재저장의 기본 사항 ufsdump와 ufsrestore # ufsdump 0cfu /dev/rmt/0 /dev/rdsk/c0t3d0s0 완전 백업 : 모든 사본 점진적 백업 : 변경만 덤프 레벨 0(완전) ~ 9(점진) 더 높은 레벨 기준 백업 스케줄 매일 점진 백업 일주일에 한번 완전 백업 스와핑(Swapping)과 스티키(Sticky) 모드 실행파일에 대하여 4000 set user ID: $ chmod 4711 myfile -rws--x--x 2000 set group ID : $ chmod 2711 myfile -rwx--s--x 1000 set sticky bit : $ chmod 1711 myfile -rwx--x--t 디렉토리에 대하여 1000 set sticky bit : $ chmod 1777 share 그 디렉토리 안의 파일 제거 또는 이름 변경은 파일 소유자, 디렉토리 소유자, 수퍼유저 만이 다른사용자는 그 안에 자기 파일 생성만 Setuid와 Setgid 모드 FIFO 파일 : pipe 유사, mknod로 생성 링크와 심볼릭 링크 : 6.4.4절 참조 장치명 : p469 표 20.2 참조 Unix

8 /etc/inittab : isis ap::sysinit:/sbin/autopush -f /etc/iu.ap
ap::sysinit:/sbin/soconfig -f /etc/sock2path fs::sysinit:/sbin/rcS >/dev/console 2<>/dev/console </dev/console is:3:initdefault: p3:s1234:powerfail:/usr/sbin/shutdown -y -i5 -g0 >/dev/console 2<>/dev/console s0:0:wait:/sbin/rc >/dev/console 2<>/dev/console </dev/console s1:1:wait:/usr/sbin/shutdown -y -iS -g0 >/dev/console 2<>/dev/console </dev/console s2:23:wait:/sbin/rc >/dev/console 2<>/dev/console </dev/console s3:3:wait:/sbin/rc >/dev/console 2<>/dev/console </dev/console s5:5:wait:/sbin/rc >/dev/console 2<>/dev/console </dev/console s6:6:wait:/sbin/rc >/dev/console 2<>/dev/console </dev/console fw:0:wait:/sbin/uadmin >/dev/console 2<>/dev/console </dev/console of:5:wait:/sbin/uadmin >/dev/console 2<>/dev/console </dev/console rb:6:wait:/sbin/uadmin >/dev/console 2<>/dev/console </dev/console sc:234:respawn:/usr/lib/saf/sac -t 300 co:234:respawn:/usr/lib/saf/ttymon -g -h -p "`uname -n` console login: " -T sun -d /dev/console -l console -m ldt erm,ttcompat Unix

9 /sbin/rc2 Unix #!/sbin/sh
# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T # All Rights Reserved # THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T # The copyright notice above does not evidence any # actual or intended publication of such source code. #ident /01/12 SMI" /* SVr */ # "Run Commands" executed when the system is changing to init state 2, # traditionally called "multi-user". # Pickup start-up packages for mounts, daemons, services, etc. PATH=/usr/sbin:/usr/bin set `/usr/bin/who -r` if [ x$9 = "xS" -o x$9 = "x1" ] then echo 'The system is coming up. Please wait.' BOOT=yes elif [ x$7 = "x2" ] echo 'Changing to state 2.' if [ -d /etc/rc2.d ] for f in /etc/rc2.d/K* { if [ -s ${f} ] case ${f} in *.sh) ${f} ;; *) /sbin/sh ${f} stop ;; esac fi } Unix

10 /sbin/rc2 (계속) Unix if [ x$9 != "x2" -a x$9 != "x3" -a -d /etc/rc2.d ]
then for f in /etc/rc2.d/S* { if [ -s ${f} ] case ${f} in *.sh) ${f} ;; # source it *) /sbin/sh ${f} start ;; # sub shell esac fi } #if [ ! -s /etc/rc2.d/.ports.sem ] #then # /sbin/ports # echo "ports completed" > /etc/rc2.d/.ports.sem #fi # Start historical section. if [ "${BOOT}" = "yes" -a -d /etc/rc.d ] for f in `/usr/bin/ls /etc/rc.d` if [ ! -s /etc/init.d/${f} ] /sbin/sh /etc/rc.d/${f} # End historical section. if [ "${BOOT}" = "yes" -a x$7 = "x2" ] echo 'The system is ready.' elif [ x$7 = "x2" ] echo 'Change to state 2 has been completed.’ Unix

11 System Boot Phases(Continued)
PROM runs self-test diagnostics Boot PROM phase PROM loads the bootblock (bootblk)program The bootblock program loads The boot(ufsboot) program Boot program phase The boot(ufsboot) program Loads the kernel The kernel initializes itself and Starts the init process Kernel initialization phase The init process starts the Run control scripts The /sbin/init phase Unix

12 The Solaris File System Structure
Label(ØSector) Bootblock(1~15sector) Superblock(8k) Backup Superblock Cylinder Group Block First cylinder group (16-32개) Inode Table(속성) Data Blocks Second cylinder group Unix

13 Solaris File System Structure
Raw and Block Partition /dev/rdsk/ : 문자 단위 /dev/dsk : 블록 단위 The Disk Label(VTOC : Volume Table of Contents) : prtvtoc /dev/dsk/c0t0d0s0 The Bootblock : bootblk program Superblock data block(=8192 bytes) 개수 cylinder group 개수 data block 과 fragment 크기 mount point 이름 Backup Superblocks : Superblock 내용 사본 Cylinder Group Blocks : inode(inode 그림 참조) 개수 cylinder group안의 data block 개수 directory 개수 사용가능(free) block, inode, fragment 사용가능 block map 사용중인 inode map Unix

14 Partition Table format> partition partition> print
Current partition table (original): Total disk cylinders available: (reserved cylinders) Part Tag Flag Cylinders Size Blocks root wm MB (813/0/0) var wm MB (1016/0/0) 2 backup wm MB (1016/0/0) swap wu MB (1016/0/0) 4 unassigned wm (0/0/0) 5 unassigned wm MB (1016/0/0) usr wm GB (3251/0/0) home wm GB (10547/0/0) Unix


Download ppt "20. 시스템 관리. 수퍼 유저(The Superuser) 시스템 구성(System Configuration)"

Similar presentations


Ads by Google