'Profile'에 해당되는 글 3건

  1. 2014.12.12 How to Disable Your Bash_History or Log Users
  2. 2010.04.11 Runas 이용한 관리자 권한으로 프로그램 실행
  3. 2009.06.12 x86 솔라리스10 오라클 10g 설치 (Oracle 10g Installation) (1)
2014. 12. 12. 19:32

How to Disable Your Bash_History or Log Users

    ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
   ██                                                                       ██
  █▌      -   DISABLING BASH_HISTORY AND/OR LOGGING ALL USER'S CMDS   -      █▌
 █▌                                                                           █▌
 █                                                                            ▐▌
 █ Once you have logged out of your shell by default bash will store the last ▐▌
 █ 500 previous cmds (commands), and/or 500 lines, you executed to your       ▐▌
 █ .bash_history file for easy recall on future sessions (Ctrl+R or ! or !!). ▐▌
 █ Even passwords that were entered as plain text, such as:                   ▐▌
 █ mysqladmin -u root password 'new-password'                                 ▐▌
 █ If you take a look at hack logs, many have "cat .bash_history". HERE is a  ▐▌
 █ an infamous example, search for: cat .bash_history                         ▐▌
 █                                                                            ▐▌
 █ I've listed a number of different methods to disable it, limit it, or stop ▐▌
 █ users from altering their own .bash_history for auditing needs. Depending  ▐▌
 █ on your own needs select a method/s.                                       ▐▌
 █                                                                            ▐▌
 █ QUICK METHOD:                                                              ▐▌
 █ TO VIEW YOUR .BASH_HISTORY:                                                ▐▌
 █ SOME COMMON BASH VARIABLES:                                                ▐▌
 █ VARIABLE NOTES:                                                            ▐▌
 █ DISABLE .BASH_HISTORY - INCLUDING CURRENT SESSION'S KEYSTROKES:            ▐▌
 █ DISABLE .BASH_HISTORY - WHILE RETAINING CURRENT SESSION'S KEYSTROKE:       ▐▌
 █ TEMPORARILY DISABLE YOUR .BASH_HISTORY:                                    ▐▌
 █ LIMIT (not disable) .BASH_HISTORY FOR ALL USERS:                           ▐▌
 █ PREVENT USERS MODIFYING THEIR .BASH_HISTORY:                               ▐▌
 █                                                                            ▐▌
 █ QUICK METHOD:                                                              ▐▌
 █ `````````````                                                              ▐▌
 █ Quick method to completely disable your own .bash_history, without reading ▐▌
 █ any further:                                                               ▐▌
 █ Remove the file:                                                           ▐▌
 █ rm ~/.bash_history -rf                                                     ▐▌
 █ Clear your current history stored in RAM:                                  ▐▌
 █ history -c                                                                 ▐▌
 █ Change your settings:                                                      ▐▌
 █ export HISTFILESIZE=0                                                      ▐▌
 █ export HISTSIZE=0                                                          ▐▌
 █ unset HISTFILE                                                             ▐▌
 █ Logout, login, done.                                                       ▐▌
 █                                                                            ▐▌
 █ Or even faster method to send .bash_history to a black hole:               ▐▌
 █ rm ~/.bash_history                                                         ▐▌
 █ ln /dev/null ~/.bash_history -sf                                           ▐▌
 █ Logout, login, done.                                                       ▐▌
 █                                                                            ▐▌
 █ TO VIEW YOUR .BASH_HISTORY:                                                ▐▌
 █ ```````````````````````````                                                ▐▌
 █ history                                                                    ▐▌
 █ or                                                                         ▐▌
 █ ls -al .bash_history                                                       ▐▌
 █ cat ~/.bash_history                                                        ▐▌
 █ The number of cmds that history will show (cmd number on left column)      ▐▌
 █ might be larger than the default 500 as it includes your current session's ▐▌
 █ cmds and what is in .bash_history.                                         ▐▌
 █ To view your top 10 bash cmds in your present history:                     ▐▌
 █ history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -n | tail | sort -nr
 █ You can re-execute any cmd on the list by entering the item number         ▐▌
 █ preceded with !                                                            ▐▌
 █ For example if on the list is the cmd above as 502, to re-execute it:      ▐▌
 █ !502                                                                       ▐▌
 █ Or to re-execute the previous cmd:                                         ▐▌
 █ !!                                                                         ▐▌
 █                                                                            ▐▌
 █ SOME COMMON BASH VARIABLES:                                                ▐▌
 █ ```````````````````````````                                                ▐▌
 █ Can skip this section; not needed to read/do:                              ▐▌
 █ Here is a list of some of the variables, with a brief description. Don't   ▐▌
 █ worry if these don't make sense now, you'll see how to use them below.     ▐▌
 █ Bash man page is HERE or in your shell prompt: man bash                    ▐▌
 █                                                                            ▐▌
 █ HISTFILE                                                                   ▐▌
 █   Set the name/path of bash history. Default is ~/.bash_history. If        ▐▌
 █   'unset' bash history is not saved after exiting.                         ▐▌
 █ HISTFILESIZE                                                               ▐▌
 █   Set the maximum number of lines to be saved in .bash_history             ▐▌
 █ HISTSIZE                                                                   ▐▌
 █   Set the number of commands to remember/store in .bash_history            ▐▌
 █ HISTTIMEFORMAT                                                             ▐▌
 █   Time stamp the commands. Example: export HISTTIMEFORMAT='%Y-%m-%d %H:%M' ▐▌
 █ HISTCONTROL                                                                ▐▌
 █   Here you can have a colon separated list of 'values' controlling what is ▐▌
 █   stored in .bash_history. Here are a few of them:                         ▐▌
 █   ignorespace - cmds that begin with a space will not be saved.            ▐▌
 █   ignoredups - cmds matching previous entries will not be saved.           ▐▌
 █   ignoreboth -  ignoredups and ignorespace combined.                       ▐▌
 █   erasedups - erases previous duplicate cmds in history before the new cmd ▐▌
 █   is saved. I prefer using this line over ignoredups with HISTTIMEFORMAT   ▐▌
 █   as the latest occurance of the cmd is saved.                             ▐▌
 █   Here is an example using the above:                                      ▐▌
 █   export HISTCONTROL=ignorespace:erasedups                                 ▐▌
 █ HISTIGNORE                                                                 ▐▌
 █   Here you can have a colon separated list of 'patterns' controlling what  ▐▌
 █   is stored in .bash_history.                                              ▐▌
 █   "[ ]*" - cmds that begin with a space will not be saved.                 ▐▌
 █   "&" - cmds matching previous entries will not be saved.                  ▐▌
 █   Here is an example that will ignore duplicate cmds, cmds that begin with ▐▌
 █   a space, and the exit cmd:                                               ▐▌
 █   export HISTIGNORE='&:[ ]*:exit'                                          ▐▌
 █ PROMPT_COMMAND                                                             ▐▌
 █   To execute a set command prior to each of your primary commands. For     ▐▌
 █   example if open multiple shell sessions and do not want each one         ▐▌
 █   overwriting your .bash_history on exit you could do this:                ▐▌
 █   export PROMPT_COMMAND=history -a; history -n                             ▐▌
 █   Or to save, append and reload history after each cmd executes:           ▐▌
 █   export PROMPT_COMMAND='history -a; history -r; $PROMPT_COMMAND'          ▐▌
 █   shopt -s histappend                                                      ▐▌
 █ TMOUT                                                                      ▐▌
 █   The number of seconds until the shell session automatically terminates   ▐▌
 █   if it doesn't receive input. A 0 value means the shell will not          ▐▌
 █   automatically terminate.                                                 ▐▌
 █                                                                            ▐▌
 █ VARIABLE NOTES:                                                            ▐▌
 █ ```````````````                                                            ▐▌
 █ 1) To activate the changes to a user's variables, the user will need to    ▐▌
 █ logout then back in (or open a new session or run the altered file).       ▐▌
 █                                                                            ▐▌
 █ 2) To list your own environment variables:                                 ▐▌
 █ env                                                                        ▐▌
 █                                                                            ▐▌
 █ If for example you have previously entered the cmd:                        ▐▌
 █ export HISTCONTROL=ignorespace                                             ▐▌
 █ You'll see 'HISTCONTROL=ignorespace' in the output of env.                 ▐▌
 █                                                                            ▐▌
 █ To view a specific variable, precede that variable with: echo $            ▐▌
 █ If there is no reply, it hasn't been manually set, and is at the default.  ▐▌
 █ For example:                                                               ▐▌
 █ echo $HISTFILESIZE                                                         ▐▌
 █ echo $HISTSIZE                                                             ▐▌
 █ echo $TMOUT                                                                ▐▌
 █                                                                            ▐▌
 █ 3) To remove a variable that you have set use 'unset'.                     ▐▌
 █ For example if you have done:                                              ▐▌
 █ export HISTSIZE=500                                                        ▐▌
 █ then remove that with:                                                     ▐▌
 █ unset HISTSIZE                                                             ▐▌
 █                                                                            ▐▌
 █ 4) Keep in mind that if you change a user's bash environment variable,     ▐▌
 █ they can change it back if the correct permissions are not set. I'll go    ▐▌
 █ over that in the section 'PREVENT USERS MODIFYING THEIR .BASH_HISTORY'.    ▐▌
 █                                                                            ▐▌
 █ 5) You might need to replace the double quotes " with single quotes ' in   ▐▌
 █ the variables below if you receive an error.                               ▐▌
 █                                                                            ▐▌
 █                                                                            ▐▌
 █ DISABLE .BASH_HISTORY - INCLUDING CURRENT SESSION'S KEYSTROKES:            ▐▌
 █ ```````````````````````````````````````````````````````````````            ▐▌
 █ With this method you will not be able to recall previous cmds (Ctrl+r).    ▐▌
 █                                                                            ▐▌
 █ FOR YOURSELF:                                                              ▐▌
 █ Clear your current history:                                                ▐▌
 █ history -c                                                                 ▐▌
 █ Remove the file:                                                           ▐▌
 █ rm ~/.bash_history -rf                                                     ▐▌
 █ Change your settings:                                                      ▐▌
 █ export HISTFILESIZE=0                                                      ▐▌
 █ export HISTSIZE=0                                                          ▐▌
 █ unset HISTFILE                                                             ▐▌
 █                                                                            ▐▌
 █ (or you could add those settings to your ~/.bash_profile)                  ▐▌
 █                                                                            ▐▌
 █ FOR A SPECIFIED USER (replace 'user' with user's name):                    ▐▌
 █ su                                                                         ▐▌
 █ Clear their history:                                                       ▐▌
 █ history -c /home/user/.bash_history                                        ▐▌
 █ Remove the file:                                                           ▐▌
 █ rm /home/user/.bash_history -rf                                            ▐▌
 █ Change their settings:                                                     ▐▌
 █ echo "export HISTFILESIZE=0" >> /home/user/.bash_profile                   ▐▌
 █ echo "export HISTSIZE=0" >> /home/user/.bash_profile                       ▐▌
 █ echo "unset HISTFILE" >> /home/user/.bash_profile                          ▐▌
 █                                                                            ▐▌
 █ FOR ALL USERS:                                                             ▐▌
 █ su                                                                         ▐▌
 █ pico /etc/profile                                                          ▐▌
 █ Add these lines at the end of the file:                                    ▐▌
 █ export HISTFILESIZE=0                                                      ▐▌
 █ export HISTSIZE=0                                                          ▐▌
 █ unset HISTFILE                                                             ▐▌
 █ ln /dev/null ~/.bash_history -sf                                           ▐▌
 █                                                                            ▐▌
 █ You'll need to remove all users .bash_history files. Find them first to be ▐▌
 █ sure these are the files you want to remove:                               ▐▌
 █ find /home -type f -name .bash_history                                     ▐▌
 █                                                                            ▐▌
 █ If your output above is correct, then to remove all of those files:        ▐▌
 █ find /home -type f -name .bash_history \                                   ▐▌
 █ -exec rm -f {} \;                                                          ▐▌
 █                                                                            ▐▌
 █ Or:                                                                        ▐▌
 █ pico /etc/bash.bashrc                                                      ▐▌
 █ Add these lines at the end:                                                ▐▌
 █ export HISTFILE=                                                           ▐▌
 █ ln /dev/null ~/.bash_history -sf                                           ▐▌
 █                                                                            ▐▌
 █ Or you could add these lines instead:                                      ▐▌
 █ export HISTSIZE=0                                                          ▐▌
 █ ln /dev/null ~/.bash_history -sf                                           ▐▌
 █                                                                            ▐▌
 █ Or you could:                                                              ▐▌
 █ echo "unset HISTFILE" >> /etc/profile                                      ▐▌
 █                                                                            ▐▌
 █ As you can see there are a number of methods that can be applied to all    ▐▌
 █ users including root.                                                      ▐▌
 █                                                                            ▐▌
 █ FOR ROOT:                                                                  ▐▌
 █ su                                                                         ▐▌
 █ Clear root history:                                                        ▐▌
 █ history -c /root/.bash_history                                             ▐▌
 █ Or:                                                                        ▐▌
 █ cat /dev/null > /root/.bash_history                                        ▐▌
 █ Send bash history to a black hole:                                         ▐▌
 █ ln /dev/null /root/.bash_history -sf                                       ▐▌
 █ rm /root/.bash_history -f                                                  ▐▌
 █                                                                            ▐▌
 █ Or you can add the settings:                                               ▐▌
 █ pico /root/.bash_profile                                                   ▐▌
 █ If that file doesn't exist then:                                           ▐▌
 █ pico /root/.bashrc                                                         ▐▌
 █ or                                                                         ▐▌
 █ pico /root/.profile                                                        ▐▌
 █ Paste these lines at the bottom:                                           ▐▌
 █ export HISTFILESIZE=0                                                      ▐▌
 █ export HISTSIZE=0                                                          ▐▌
 █ unset HISTFILE                                                             ▐▌
 █                                                                            ▐▌
 █ If you choose to do this for root you should consider a logging program    ▐▌
 █ to monitor root actions and if possible have the logs sent live to another ▐▌
 █ server.                                                                    ▐▌
 █                                                                            ▐▌
 █ DISABLE .BASH_HISTORY - WHILE RETAINING CURRENT SESSION'S KEYSTROKE:       ▐▌
 █ ````````````````````````````````````````````````````````````````````       ▐▌
 █ To be able to recall the current session's recent cmds (Ctrl+r) for        ▐▌
 █ example to 30 lines, in all the statements above for 'export HISTSIZE=0'   ▐▌
 █ change to:                                                                 ▐▌
 █ export HISTSIZE=30                                                         ▐▌
 █                                                                            ▐▌
 █ Or you could:                                                              ▐▌
 █ export HISTFILE=/dev/null                                                  ▐▌
 █                                                                            ▐▌
 █ Or you could:                                                              ▐▌
 █ pico ~/.bashrc                                                             ▐▌
 █ Add this line:                                                             ▐▌
 █ HISTFILE=/dev/null                                                         ▐▌
 █                                                                            ▐▌
 █ TEMPORARILY DISABLE YOUR .BASH_HISTORY:                                    ▐▌
 █ ```````````````````````````````````````                                    ▐▌
 █ If you want to temporarily disable the logging of your commands, first:    ▐▌
 █ unset HISTFILE                                                             ▐▌
 █ Or you could:                                                              ▐▌
 █ export HISTFILE=/dev/null                                                  ▐▌
 █ Run your cmds, then reset it:                                              ▐▌
 █ export HISTFILE=~/.bash_history                                            ▐▌
 █ Or if you didn't care to save the .previous .bash_history and kill         ▐▌
 █ everything without a wait, after you are finished (not recommended) log    ▐▌
 █ out with this cmd:                                                         ▐▌
 █ rm ~/.bash_history -f && kill -9 $$                                        ▐▌
 █                                                                            ▐▌
 █ LIMIT (not disable) .BASH_HISTORY FOR ALL USERS:                           ▐▌
 █ ````````````````````````````````````````````````                           ▐▌
 █ pico /etc/profile                                                          ▐▌
 █ Add these lines at the end, or adjust if already there to limit users to   ▐▌
 █ 20 previous cmds:                                                          ▐▌
 █ HISTFILESIZE=30                                                            ▐▌
 █ HISTSIZE=30                                                                ▐▌
 █                                                                            ▐▌
 █ PREVENT USERS MODIFYING THEIR .BASH_HISTORY:                               ▐▌
 █ ````````````````````````````````````````````                               ▐▌
 █ Keep in mind that the methods below for bash are not impossible to bypass, ▐▌
 █ as clever users can find ways around this such as few methods that I have  ▐▌
 █ read about and listed below.                                               ▐▌
 █                                                                            ▐▌
 █ 1) To not allow users (or even root) to modify, move, or delete their      ▐▌
 █ .bash_history you need to set an attribute to append only (replace user    ▐▌
 █ with the user's name):                                                     ▐▌
 █ su                                                                         ▐▌
 █ chattr +a /home/user/.bash_history                                         ▐▌
 █ FreeBSD it would be: sappnd /home/user/.bash_history                       ▐▌
 █                                                                            ▐▌
 █ You should also set append only to all the other bash configuration files. ▐▌
 █ When users logs in, bash reads first from /etc/profile, then the first     ▐▌
 █ three in this order:                                                       ▐▌
 █ chattr +a /home/user/.bash_profile                                         ▐▌
 █ chattr +a /home/user/.bash_login                                           ▐▌
 █ chattr +a /home/user/.profile                                              ▐▌
 █ chattr +a /home/user/.bashrc                                               ▐▌
 █ chattr +a /home/user/.bash_logout                                          ▐▌
 █                                                                            ▐▌
 █ .bashrc is read when                                                       ▐▌
 █ A. another interactive shell is started, for example by entering: bash and ▐▌
 █ B. When it is referred to from the other .bash files containing .bashrc in ▐▌
 █ their body - so that means in every case.                                  ▐▌
 █                                                                            ▐▌
 █ Here is an example to change the perms to +a on all the files listed       ▐▌
 █ above, in all the users /home directory, in mass:                          ▐▌
 █ You might want to search files first to know you have all/only the correct ▐▌
 █ files:                                                                     ▐▌
 █ find /home -type f -name .bash\*                                           ▐▌
 █ find /home -type f -name .profile                                          ▐▌
 █                                                                            ▐▌
 █ Then to change to the perms:                                               ▐▌
 █ find /home -type f -name .bash\* \                                         ▐▌
 █ -exec chattr +a {} \;                                                      ▐▌
 █ find /home -type f -name .profile \                                        ▐▌
 █ -exec chattr +a {} \;                                                      ▐▌
 █                                                                            ▐▌
 █ Even for root to edit files that are set to chattr +a that attribute must  ▐▌
 █ be removed first.                                                          ▐▌
 █ To view chattr attributes on the file:                                     ▐▌
 █ lsattr .bash_history                                                       ▐▌
 █ Output would be: -----a-------------                                       ▐▌
 █ To remove an 'a' attribute:                                                ▐▌
 █ chattr -a .bash_history                                                    ▐▌
 █ Or if lsattr replied with an 'i' then -i. The i attribute is immutable- no ▐▌
 █ append ability.                                                            ▐▌
 █ To know more about chattr view HERE, or man chattr                         ▐▌
 █                                                                            ▐▌
 █ 2) Then you need to set the variables so that each cmd a user executes is  ▐▌
 █ logged immediately, and variables are set to read only so that users can't ▐▌
 █ change them such as the size, location, and log all cmds. To do this:      ▐▌
 █ pico /etc/profile                                                          ▐▌
 █ Add the following lines to the bottom of the file:                         ▐▌
if [ "$BASH" ]; then
	PROMPT_COMMAND="history -a;$PROMPT_COMMAND";
	readonly PROMPT_COMMAND
	readonly HISTSIZE
	readonly HISTFILE
    readonly HISTFILESIZE
    readonly HISTCMD
	readonly HOME
	readonly HISTIGNORE
	readonly HISTCONTROL
fi
 █                                                                            ▐▌
 █ 3) Disable access to other shells programs on the system so the users must ▐▌
 █ use bash. Some of the more common ones are csh, tcsh and ksh.              ▐▌
 █ To find location of program; which [program], for example:                 ▐▌
 █ which csh                                                                  ▐▌
 █ which tcsh                                                                 ▐▌
 █                                                                            ▐▌
 █ chmod 750 /bin/csh                                                         ▐▌
 █ chmod 750 /usr/bin/tcsh                                                    ▐▌
 █                                                                            ▐▌
 █ On standard Debian install there is csh (/bin/csh) and tcsh                ▐▌
 █ (/usr/bin/tcsh). Find out what other shells are installed on your own      ▐▌
 █ system.                                                                    ▐▌
 █                                                                            ▐▌
 █ 4) Doing this tho will still not prevent a way out of the above settings   ▐▌
 █ for bash.                                                                  ▐▌
 █ Here are a few examples a user could type in to bypass the steps above:    ▐▌
 █ Bash will mimic sh, not using the configurations files related to bash:    ▐▌
 █ /bin/sh                                                                    ▐▌
 █ Or if it exist:                                                            ▐▌
 █ /bin/rbash                                                                 ▐▌
 █ Then user is able to bypass logging for current session by:                ▐▌
 █ unset HISTFILE                                                             ▐▌
 █                                                                            ▐▌
 █ Or a user can launch bash with variables to not read the .bashrc file:     ▐▌
 █ /bin/bash --norc                                                           ▐▌
 █ HISTFILE=                                                                  ▐▌
 █                                                                            ▐▌
 █ //----------------------------------------------------------------------   ▐▌
 █                                                                            ▐▌
 █ If you find mistakes, have suggestions, and or questions please post at    ▐▌
 █ mewbies forum HERE - thank you.                                            ▐▌
 █                                                                            ▐▌
 █ Last update on 20 Jul '10                                                  ▐▌
 █                                                                            ▐▌
 █▌                                                                           █▌
  █▌                          -   mewbies.com   -                            █▌
   █▌                                                                       █▌
    ██▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄██
 


출처 : mewbies.com



Trackback 0 Comment 0
2010. 4. 11. 18:17

Runas 이용한 관리자 권한으로 프로그램 실행

> 주제 : Runas를 이용하여 일반계정에서 관리자 권한 실행하기 

*개요

 - runas를 이용하면 서버로 직접 로그인 하지 않아도, Client에서 관리자 권한으로 관리 도구를 사용할 수 있다.
 - runas를 이용하면 여러가지 프로그램을 원하는 계정으로 실행할 수 있다.(관리도구나 메모장 등)
 - 실습을 위해 S1과 S2 서버가 구동되어 있어야 한다.

*학습 목표

 - runas 실행 방법 익히기
 - 문제발생시 해결


# runas를 이용하여 관리도구의 'Active Directory 사용자 및 컴퓨터'를 실행해 보자

 1. CMD창에서 'runas'의 사용법을 훑어보자.(시작 -> 실행 -> CMD -> runas /? 입력후 엔터)

 

*참고

 RUNAS [ [/noprofile | /profile] [/env] [/netonly] ] /user:<UserName> 프로그램
 : 명령어의 대괄호 안의 옵션은 생략 가능하지만, /user 부분은 반드시 입력해야 실행이 가능하다.

  

2. runas를 이용하여 XP1의 관리자계정으로 Active Directory 사용자 및 컴퓨터 프로그램을 실행해봤지만, 도메인 관리자 권한을 가진 사용자로 로그온을 하라는 경고 메시지가 나온다.

 

3. 경고메시지 확인후 프로그램은 실행되지만, 도메인 정보는 표시되지 않는다.

 

4. CMD창에 아까와는 다르게 S1(서버1)의 itstar.vm 도메인의 관리자계정을 입력해 주면, 프로그램이 실행되고 도메인 정보도 표시된다.

 

5. 이번에는 S2의 자식 도메인인 child.itstar.vm의 관리자계정으로 해주어도 실행된다.

 

6. 3개의 계정으로 실행되어진 'Active directory 사용자 및 컴퓨터' 결과를 확인해 보자.



출처 : http://www.cyworld.com/namacoel

Trackback 0 Comment 0
2009. 6. 12. 14:31

x86 솔라리스10 오라클 10g 설치 (Oracle 10g Installation)

[출처정보]
작성자 : 썬구루, 
http://cafe.naver.com/symantecedu 카페
소   속 : 바쉬텍 교육센터 ( http://www.vashtechedu.com )

솔라리스10 기반의 오라클 10g 를 설치하는 방법을 올려 놓습니다.
오라클 공부하시는데 많은 도움이 되시길 바랍니다. ^^

------------- 설치환경 ------------
OS : VMware 기반의 솔라리스10 x86
메모리 : 720M
HDD : 15GB

1. /etc/system 커널초기화 파일

# vi /etc/system  (수정후 리부팅이 한번 필요)

/etc/system 파일
set shmsys:shminfo_shmmax=4294967295
set shmsys:shminfo_shmni=100
set semsys:seminfo_semmni=100
set semsys:seminfo_semmsl=256
set rlim_fd_cur=1024
set rlim_fd_max=8196

-- /etc/system 파일 설명 --
shmsys:shminfo_shmmax : 단일 공유메모리의 세그먼트(segment) 크기를 지정한다.
shmsys:shminfo_shmmni : 생성 될 수 있는 공유메모리 세그먼트의 개수
semsys:seminfo_semmni : 세마포어 식별자의 최대개수.
semsys:seminfo_semmsl : 세마포어 식별자당 System V 세마포어 최대개수.
rlim_fd_cur : 하나의 프로세스가 열수있는 파일 디스크립터 ( File Descriptor ) 의 soft limit 를 정의한다.
rlim_fd_max : 하나의 프로세스가 열수있는 파일 디스크립터 ( File Descriptor ) 의 hard limit 를 정의한다. 

2. oracle 계정생성

# groupadd dba
# useradd -s /bin/ksh -g dba -m -d /oracle oracle

3. oracle 계정 쉘 초기화파일 생성 ( .profile )

# su - oracle
$ vi .profile
export ORACLE_BASE=/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10g
export ORACLE_SID=vashtech
export DISPLAY=:0.0
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export NLS_LANG=AMERICAN_AMERICA.KO16KSC5601
export NLS_DATE_FORMAT='YYYY-MM-DD:HH24:MI:SS'
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/usr/share/lib
export PATH=$ORACLE_HOME/bin:/usr/local/bin:/usr/bin:/usr/sbin:/usr/ccs/bin
export EDITOR=vi
set -o vi

4. 오라클 다운로드

오라클은 아래와 같은 웹에서 다운로드를 받을 수 있다. 물론 가입을 해야 한다.
가입 없이 요즘은 다운로드 받을 수 있는 것이 없을 정도 이다. ^^

http://www.oracle.com 

5. xhost 설정

root 계정으로 xhost에 대한 정의를 한다.
oracle 계정으로 오라클 설치시 DISPLAY 변수의 해결을 하기 위해 사용한다. 

6. 오라클 ( Oracle 10g ) 설치

오라클 설치파일을 모두 받았다면 ftp를 사용하여 솔라리스10 시스템으로 업로드 한다.
그리고 그 파일을 풀면 database라는 디렉토리가 생성이 되며 관련 파일들이 풀리도록 되어 있다.
그 디렉토리의 runInstaller 라는 실행파일을 실행하여 오라클 설치를 시작한다. 






거의 설치 마무리 단계이다. 아래와 같은 스크립트를 root 계정으로 실행한다.


오~! 설치종료~! 설치가 다 되었으면 자동으로 오라클 프로세스가 시작이 되어 있다.


보통은 일반적인 연습을 위해 hr 계정을 사용한다. 그리고 이 계정은 lock이 걸려져 있다.
그래서 다음과 같은 명령을 사용하여 풀어 준다.

hr 계정으로 로그인하여 테스트를 해보자. 자신이 가지고 있는 테이블에 대한 정보를 보기 위해
아래와 같은 명령을 사용할 수 있다.

음.. 이제 부터 오라클 공부의 시작인가? 설치를 하니 다시 공부의 출발점이 군요.
운영체제나 기타 응용프로그램의 학습에 대한 출발점은 모두 설치이죠.
열공을 해서 데이터베이스를 마스터 하시길.. 

여러분의 데이터베이스 학습의 성공적인 출발을 기원하며...



Trackback 1 Comment 1
  1. 나그네 2010.08.07 22:45 address edit & del reply

    좋은 정보 감사합니다. 유용하게 잘 쓰겠습니다. 저도 설치해볼려고 했거덩요....ㅠㅠ