martes, 12 de abril de 2011

Cambiando permisos y Comandos basicos LINUX CentOS

Comando Basicos de Linux en el entorno de CentOS

cambiar propiedades del archivo
# chown guest4 registro4 

cambiar de ususario y grupo a un archivo
# chown guest4.guest4 registro4
cambiar grupo a un archivo
# chgrp grupo4 registro4

[root@localhost ~]# ls -l
total 108
-rw------- 1 root   root    4418 abr  9 08:44 anaconda-ks.cfg
drwxr-xr-x 2 root   root    4096 abr 12 13:00 Desktop
-rw-r--r-- 1 root   root   62179 abr  9 08:43 install.log
-rw-r--r-- 1 root   root       0 abr  9 08:20 install.log.syslog
-rw-r--r-- 1 root   root       0 abr 12 13:52 ls
-rw-r--r-- 1 guest4 grupo4    16 abr 12 13:53 registro4

CAMBIANDO PERMISOS EN LOS ARCHIVOS : 

-rw------- 

PRIMERA COLUMNA
- : es un archivo
d: es un dorectorio

-rw------- 1 root   root    4418 abr  9 08:44 anaconda-ks.cfg
drwxr-xr-x 2 root   root    4096 abr 12 13:00 Desktop

-+---+---+---
1  2   3   4

1: AREA DE TIPO DE FICHERO
2: AREA DE PERMISO DE USUSARIO
3: AREA DE PERMISO DE GRUPO
4: AREA DE PERMISO DE OTROS
   
   r = leer
   w = escribir
   x = ejecutar
   - = sin permiso

el orden es - rwx r-x r-x

#chmod el comando usa por bloque los siguientes opcion
r = 4, w = 2, x = 1, - = 0 } la suma total o los permisos totales seria de 7

Permisos por defecto para ARCHIVOS 644
Permisos por defecto para CARPETAS 755

[root@localhost ~]# chmod 543 registro4
[root@localhost ~]# ls -l
total 108
-rw------- 1 root   root    4418 abr  9 08:44 anaconda-ks.cfg
drwxr-xr-x 2 root   root    4096 abr 12 13:00 Desktop
-rw-r--r-- 1 root   root   62179 abr  9 08:43 install.log
-rw-r--r-- 1 root   root       0 abr  9 08:20 install.log.syslog
-rw-r--r-- 1 root   root       0 abr 12 13:52 ls
-r-xr---wx 1 guest4 grupo4    16 abr 12 13:53 registro4
el color verde es un archivos ejecutable



Prof. Carlos Jara - Idatux

No hay comentarios:

Publicar un comentario