본문 바로가기
IT 이야기 - About IT

HP-UX Admin 1 (Chapter 3-5)

by 회사원 주씨 2008. 7. 31.
반응형

------------------------------------------------------------------------------
Module 3 Creating and Managing User Accounts
-----------------------------------------------------------------------------

dmesg : 시스템 관련 정보들 보기(메모리, CPU ...)
uname -m : 모델명 출력
uname -a : OS정보 전체 출력

< 사용자 계정 생성 방법>

1. SAM이용 계정 생성
- 환경 파일 자동생성

2. manual 방식( /etc/passwd , /etc/group, /etc/skel)
- 관련된 파일을 직접 수정하는 방법
- 환경 파일 copy후 소유권 변경

3. 명령어를 이용한 방식
- 옵션을 주면 환경파일을 생성할수 있음

# useradd -u 유저ID -g 그룹ID -d 홈디렉토리 -s 기본쉘설정 -m -k /etc/skel 유저이름
# useradd -u 101 -g 1000 -d /home/gwchoi -s /usr/bin/sh -m -k /etc/skel gwchoi

< /etc/passwd 파일 내용>

유저이름:암호화된패스워드:유저ID:그룹ID:설명:홈디렉토리:기본수행쉘

# /usr/sbin/vipw : 내가 저장하고 나갈때까지 다른 사람은 저장할수 없음
# /usr/sbin/pwck : /etc/passwd의 내용이 틀린것이 없는지 검사

< /etc/group> 파일 내용>

그룹이름:패스워드(보통null로 세팅):그룹ID:그룹에속한유저리스트

# /usr/sbin/grpck : /etc/group의 내용이 틀린것이 없는지 검사

< SAM으로 계정 생성>

- 계정 파일 생성
- 환경 파일 설정(shell, 홈 디렉토리)

< SAM의 Template로 유저 생성>

- First Available : 현재 할당된 UID중 가장 큰 수 다음의 수를 UID로 할당합니다.
- First Available greater than Value : 입력한 값보다 큰 ID를 순차적으로 할당.
- First Available within range : 입력한 범위 안의 값을 UID로 할당
- Prompt for it : 사용자 생성시 UID를 입력하도록 한다.

< SAM으로 사용자 삭제시 옵션>

- Left where They Are : 단지 비활성화만 시킴.
- Removed from User's Home Directory Only : 사용자의 홈 디렉토리만 삭제
- Removed from All Local File Systems : 사용자의 모든 파일들을 삭제.
- Assigned to Another User : 다른 사용자에게 모두 할당.

- /etc/sam/rmuser.excl : 지워져서는 안되는 사용자의 리스트들
- /etc/sam/rmfiles.excl : 사용자를 삭제를 하더라도 지워져서는 안되는 파일들의 리스트들
- /etc/sam/rmgroup.excl : 삭제되어서는 안되는 그룹의 리스트들


< 명령어 방식으로 유저 생성시 주의사항>

# useradd gwchoi

- 위의 명령어를 통해 유저생성시 /etc/passwd 부분에서 생성된 gwchoi계정의 패스워드 부분에
*가 되어 있는데 이것을 삭제해 줘야 한다.
- 위의 명령어로 유저를 생성하면 환경 setting은 하지 않는다.
- 따라서 다음과 같은 절차를 수행하면 된다.

# mkdir /home/gwchoi
-> 환경 파일이 생성되지 않았기 때문에 환경 파일을 생성해야 한다.

# cp /etc/skel/.* /home/gwchoi
# chown -R gwchoi:그룹명 /home/gwchoi
# ls
.cshrc .exrc .login .profile .sh_history


------------------------------------------------------------------------------
Module 4 Customizing User Accounts
-----------------------------------------------------------------------------

Why Customizing a User Account?

- Set the user's terminal type
- Customize the user's prompt
- Set the user's default printer
- Customize the user's PATH variable
- Define a command line editor

- root용 환경 원본 파일 : /usr/newconfig/.profile
- 일반 유저용 환경 원본 파일 : /etc/skel


환경변수 Setting

# export TERM='vt100' : 터미널 설정 vt100은 netterm, vt200은 X-win
# export PS1=`$PWD $` : 프롬프트 설정
# export LPDEST='laser' : 디폴트 프린터 설정
# export EDITOR=vi : 디폴트 편집기 설정
# export HISTSIZE=50 : 한 라인에 실행되는 커맨드의 길이 설정
# export HISTFILE=~/.sh_history : 유저가 실행하는 커맨드가 기록되는 곳


< Login 절차>

1) login, passwd 화면 표시(csh login script, POSIX login scripts)
2) system login script(/etc/csh.login, /etc/profile)
3) local login script($HOME/.login, $HOME/.profile)
4) additional local login script($HOME/.cshrc, $HOME/.kshrc)


- 같은 환경변수가 설정되어 있을때 개인변수가 최우선으로 적용된다.
- /etc/copyright 와 /etc/motd 파일 : 로그인시 설정한 Text를 보여준다.(사용자 임의 수정 가능)


< CDE login>

1) login, passwd 화면 표시
2) $HOME/.dtprofile
3) CDE home Session

- $HOME/.profile 과 $HOME/.login 스크립트는 CDE 에 의해서 실제로 참조되지 않으나
- 강제로 .dtprofile 파일의 DTSOURCEPROFILE="true" 같이 true 라고 수정을 하면
환경설정 파일을 참조할 수 있음.
- 사용자가 CDE로 처음 로그인 하였을 경우 .dtprofile은
/usr/dt/config/sys.dtprofile 로부터 복사되어 존재.
- 만약 sys.dtprofile 의 내용을 변경시키면 /etc/dt/config로 내용을 복사하게 되어 시스템에 반영됨.

< /etc/skel 디렉토리 >

- /etc/skel/.profile : ksh 나 POSIX 에서 사용자별 로그인시 참조되는 파일
- /etc/skel/.login : csh 에서 사용자별 로그인시 참조되는 파일
- /etc/skel/.cshrc : csh 에서 추가적인 사용자 환경 참고 파일
- /etc/skel/.exrc : 각 사용자의 디폴트 vi 에디터 환경을 설정하는 파일


------------------------------------------------------------------------------
Module 5 Guide Tour of the HP-UX File Hierarchy
------------------------------------------------------------------------------

< General directories>

/usr : Sharable operating system commands, library, and documentation
/sbin : Minimum command needed to boot the system and mount other file systems
/opt : Applications
/etc : System configuration files. No longer contain executable files
/dev : Device files
/var : Dynamic infomation such as logs spooler files
/mnt : Local Mounts
/tmp : Operating System temporary files
/stand : Kernel and boot loader
/home : user directories


< /usr directories>

/usr/bin : Operating system user commands
/usr/conf : Kernel configuration
/usr/contrib : Contributed software
/usr/lbin : Back-ends to other commands
/usr/local : User-contributed software
/usr/newconfig : Default operation system configuration data file
/usr/sbin : System administration commands
/usr/share : Architecture independent sharable files
/usr/share/man : Operating System man pages
/usr/share/doc : White papers on technical topics


< /var directories>

/var/adm : Common Administrative files and log files
/var/adm/crash : Kernel crash dumps
/var/mail : Incoming mail
/var/opt : Application-specific runtime files(logs, temporary files)
Each application will have its own directory
/var/spool : Spooled files used by subsystems such as lp, cron, software distributor
/var/tmp : Temporary files generated by commands in the /usr hierarchy


find : Serach the file hierarchy
whereis : Locates source, binaries and man pages
which : which an executable in your PATH
file : Determines file type
strings : file형식이 data일때 내부의 string문자열을 볼수 있는 명령어

728x90

'IT 이야기 - About IT' 카테고리의 다른 글

[Weblogic] 웹로직서버 8.1sp1 설치  (0) 2008.08.01
HP-UX Admin 1 (Chapter 6-8)  (0) 2008.07.31
HP-UX Admin 1 (Chapter 9-12)  (0) 2008.07.31