-------------------------------3.权限,用户,组
[root@instructor Share]# chmod -R 777 database/#递归授权
#----------------chown 修改所属组
root@instructor bin]# groupadd dba
[root@instructor bin]# groupadd oinstall
[root@instructor database]# cat /etc/group
#查看用户组
gdm:x:42:
dba:x:500:Oracle
oinstall:x:501:
h2:x:502:
cswggod:x:503:
[root@instructor bin]# useradd -d /home/oracle -m -g oinstall -G dba oracle
#------- -d, --home-dir HOME_DIR home directory of the new account
#------- -g, --gid GROUP name or ID of the primary group of the new account 主组
#------- -G, --groups GROUPS list of supplementary groups of the new account 副组
#------- -m, --create-home create the user's home directory
#-------
[root@instructor database]# cat /etc/passwd
#查看用户
oracle:x:500:501::/home/oracle:/bin/bash
h2:x:501:502::/home/h2:/bin/bash
cswggod:x:502:503::/home/cswggod:/bin/bash
#或使用id oracle命令查看
--------------------------------
[root@instructor bin]# passwd oracle
Changing password for user oracle.
New password:
BAD PASSWORD: it is based on a dictionary word
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
[root@instructor bin]# mkdir -p /app/oracle/product/11.2.0/dbhome_1
#/*--------------------权限举例------------------------------
[root@instructor database]# pwd
/var/Share/database
[root@instructor database]# cd ..
[root@instructor Share]# pwd
/var/Share
[root@instructor Share]# mkdir test
[root@instructor Share]# ls -al
total 2385352
drwxrwxrwx. 7 root root 4096 Oct 21 18:16 .
drwxr-xr-x. 24 root root 4096 Oct 21 00:22 ..
drwxr-xr-x. 9 root root 4096 Jul 20 2007 apache-tomcat-6.0.14
-rw-r--r--. 1 root root 6452660 May 24 2008 apache-tomcat-6.0.14.zip
drwxrwxrwx. 8 oracle oinstall 4096 Aug 20 2009 database
drwxr-xr-x. 2 root root 4096 Oct 21 01:52 javacord
drwxr-xr-x. 10 root root 4096 Oct 21 00:39 jdk1.6.0_27
-rwxrwxrwx. 1 root root 85418489 Oct 21 00:08 jdk-6u27-linux-x64.bin
-rw-r--r--. 1 root root 1239269270 Oct 17 08:04 linux.x64_11gR2_database_1of2.zip
-rw-r--r--. 1 root root 1111416131 Oct 17 08:06 linux.x64_11gR2_database_2of2.zip
drwxr-xr-x. 2 root root 4096 Oct 21 18:16 test
[root@instructor Share]# mkdir -p test/test1
-------------------1.修改所有者
[root@instructor Share]# chown -R oracle test
[root@instructor Share]# ls -al test
total 12
drwxr-xr-x. 3 oracle root 4096 Oct 21 18:17 .
drwxrwxrwx. 7 root root 4096 Oct 21 18:16 ..
drwxr-xr-x. 2 oracle root 4096 Oct 21 18:17 test1
[root@instructor Share]# ls -al test/test1
total 8
drwxr-xr-x. 2 oracle root 4096 Oct 21 18:17 .
drwxr-xr-x. 3 oracle root 4096 Oct 21 18:17 ..
[root@instructor Share]#
-----------------2.修改所属组
[root@instructor Share]# chown -R oracle:oinstall test
[root@instructor Share]# ls -al test/test1
total 8
drwxr-xr-x. 2 oracle oinstall 4096 Oct 21 18:17 .
drwxr-xr-x. 3 oracle oinstall 4096 Oct 21 18:17 ..
[root@instructor Share]# ls -al test
total 12
drwxr-xr-x. 3 oracle oinstall 4096 Oct 21 18:17 .
drwxrwxrwx. 7 root root 4096 Oct 21 18:16 ..
drwxr-xr-x. 2 oracle oinstall 4096 Oct 21 18:17 test1
[root@instructor Share]#
#--------------------权限举例------------------------------*/
-------------------------------4.目录
[root@instructor /]# chown -R oracle app
[root@instructor /]# chown -R oracle:oinstall app
[root@instructor /]# ls -al app/oracle/
total 12
drwxr-xr-x. 3 oracle oinstall 4096 Oct 21 01:31 .
drwxr-xr-x. 3 oracle oinstall 4096 Oct 21 01:31 ..
drwxr-xr-x. 3 oracle oinstall 4096 Oct 21 01:31 product
[root@instructor /]#
