En Red Hat, y en linux en general, encontramos que todo esta basado en archivos, inclusive los directorios en realidad son archivos especiales donde en su estructura se lista los archivos que contiene, pero esto lo veremos en una entrada posterior sobre el sistema de archivos y los inodos. Adicional a esto, para todos los archivos tenemos un usuario propietario y un grupo propietario:
[niquepa@vm1 ~]$ ls -l /tmp/
-rw-r–r– 1 niquepa wordpress 192 Jun 23 13:40 basura
-rw-r–r– 1 root root 109 Jun 23 16:47 abc.txt
-rw-r–r– 1 root root 381 Nov 10 2005 index.html
drwx—— 2 root root 4096 Jun 23 16:38 deploy
-rw-rw-r– 1 zabbix zabbix 26976 Jun 18 17:08 zabbix_agentd.log
[niquepa@vm1 ~]$
en el anterior comando podemos observar que para el archivo “basura” el usuario propietario es “niquepa” y el grupo propietario es “wordpress”, al igual que para el directorio “deploy”. Existe una manera de cambiar estos propietarios, para efectos de seguridad principalmente, y es por medio de dos comandos “chown” y “chgrp”, aunque con “chown” es más que suficiente.
chown Asigna el usuario propietario, y el grupo propietario si asi se quiere chgrp Asigna el grupo propietario, en caso de solo querer cambiar el grupo
Sintaxis para usar chown:
chown [OPCIONES]... [USUARIO][:GRUPO] ARCHIVO...
a continuación mostramos dos ejemplos de que como se usa, y en rojo se pueden evidenciar los cambios:
[niquepa@vm1 ~]$ ls -l /tmp/
-rw-r–r– 1 niquepa wordpress 192 Jun 23 13:40 basura
-rw-r–r– 1 root root 109 Jun 23 16:47 abc.txt
-rw-r–r– 1 root root 381 Nov 10 2005 index.html
drwx—— 2 root root 4096 Jun 23 16:38 deploy
-rw-rw-r– 1 zabbix zabbix 26976 Jun 18 17:08 zabbix_agentd.log
[niquepa@vm1 ~]$ chown root basura
[niquepa@vm1 ~]$ ls -l /tmp/
-rw-r–r– 1 root wordpress 192 Jun 23 13:40 basura
-rw-r–r– 1 root root 109 Jun 23 16:47 abc.txt
-rw-r–r– 1 root root 381 Nov 10 2005 index.html
drwx—— 2 root root 4096 Jun 23 16:38 deploy
-rw-rw-r– 1 zabbix zabbix 26976 Jun 18 17:08 zabbix_agentd.log
[niquepa@vm1 ~]$ chown -R niquepa:wordpress deploy
[niquepa@vm1 ~]$ ls -l /tmp/
-rw-r–r– 1 root wordpress 192 Jun 23 13:40 basura
-rw-r–r– 1 root root 109 Jun 23 16:47 abc.txt
-rw-r–r– 1 root root 381 Nov 10 2005 index.html
drwx—— 2 niquepa wordpress 4096 Jun 23 16:38 deploy
-rw-rw-r– 1 zabbix zabbix 26976 Jun 18 17:08 zabbix_agentd.log
al escribir dentro de las opciones -R estamos diciendo que queremos cambiar de manera recursiva el propietario para todos los archivos que contenga la carpeta. dentro de las posibles opciones tenemos:
-c, --changes Reporta unicamente los cambios realizados sobre archivos o carpetas --dereference Afecta el archivo o carpeta que se referencia en un link simbolico, en lugar de modificar el link simbolico como tal, Asi se comporta por defecto -h, --no-dereference Afecta el link simbolico en lugar de su referencia -f, --silent, --quiet Ejecuta de manera silenciosa -R, --recursive Ejecuta de manera recursiva para directorios -v, --verbose Muestra mensajes en pantalla de cada archivo o carpeta procesados
Sintaxis para usar chgrp:
chgrp [OPTION]... GROUP FILE...
Por medio de este comando modificaremos unicamente el grupo propietario de los archivos o las carpetas deseadas, y tiene las mismas opciones disponibles que “chown”
Tags: archivo, carpeta, chgrp, chown, dueño, group, grupo, linux, owner, propietario, redhat, rhel, user, usuario
infraestructura de redes…
I found your entry interesting thus I’ve added a Trackback to it on my weblog
…
infraestructura de redes…
I found your entry interesting thus I’ve added a Trackback to it on my weblog
…
Hrmm that was weird, my comment got eaten. Anyway I wanted to say that it’s nice to know that someone else also mentioned this as I had trouble finding the same info elsewhere. This was the first place that told me the answer. Thanks.
This is a smart blog. I mean it. You have so much knowledge about this issue, and so much passion. You also know how to make people rally behind it, obviously from the responses. Youve got a design here thats not too flashy, but makes a statement as big as what youre saying. Great job, indeed.
Lucky i discovered , this amazing site, Another good site is Dbolwill make sure to bookmark it so i can come to frequently.
Thankful i ran across this site, will be sure to save it, Another good site is Dbol so i can pay a visit to frequently.
Cool post cheers, do you twitter?
Lucky i ran across this excellent website, Another good site is Dbol will be sure to bookmark it so i can check-out regularly.
Bookmarking now thanks, a good quick read.
Wow! Thank you! I always wanted to write in my site something like that. Can I take part of your post to my blog?
Thanks so much for writing all of the excellent information! Looking forward to checking out more posts!
Great posts. I will come back to this blog on the regular.
makeup brushes is good is excellent
Really appreciate this post. It’s hard to sort the good from the bad sometimes, but I think you’ve nailed it!
Well, I do not know if that’s going to work for me, but definitely worked for you!
Excellent post!
Hey, just looking around some blogs, seems a pretty nice platform you are using. I’m currently using WordPress for a few of my sites but looking to change one of them over to a platform similar to yours as a trial run. Anything in particular you would recommend about it?
Audio began playing any time I opened up this internet site, so annoying!
Thank you for another essential article. Where else could anyone get that kind of information in such a complete way of writing? I have a presentation incoming week, and I am on the lookout for such information.
I think one of your advertisings caused my browser to resize, you may well want to put that on your blacklist.
Finally, got what I was on the lookout for! I am definitely enjoying reading each bit of it. Delighted I stumbled onto this article Comandos linux para asignar propietario de archivos y carpetas | Infraestructura y Servicios! I have you bookmarked to take a look at new stuff you publish.
Hey, is your RSS button working??
Audio started playing anytime I opened up this internet site, so annoying!
This is a smart blog. I mean it. You have so much knowledge about this issue, and so much passion. You also know how to make people rally behind it, obviously from the responses. Youve got a design here thats not too flashy, but makes a statement as big as what youre saying. Great job, indeed. wajadud555
Terrific article, I have saved this webpage so ideally I’ll discover much more on this subject in the future!
If you could e mail me with a few tips on just how you made your blog look this great, I would be grateful.
Thank you, I have been looking for facts about this subject for ages and yours is the best I have discovered so far.
naklejki ścienne to wspaniałe dekoracje do mieszkania naklejki na ściany ornamenty architektura naklejki scienne
Comandos linux para asignar propietario de archivos y carpetas | Infraestructura y Servicios was a good article, thank you for sharing this informative news. It’s always good when you cannot only be informed, but in addition be entertained! I’ll visit your weblog regularly for the most recent stuff.
Nice site, nice and easy on the eyes and great content too.
Reading this post Comandos linux para asignar propietario de archivos y carpetas | Infraestructura y Servicios reminds me of my old roommate! He always kept talking about this. I’ll forward this post to him. Pretty positive he will have a superb read. Thank you for the information you post.
I needed to say that it is great to know that someone discussed this as I had problems discovering the same information elsewhere. This is the first site that gave me the info. Thanks.
Oh really? Wow I didn’t know that! Thanks for sharing.
I was more than happy to find this website. I wanted to thank you for this nice article Comandos linux para asignar propietario de archivos y carpetas | Infraestructura y Servicios! I positively loved every bit of it and I have you bookmarked to take a look at new stuff you write.
Good post. I couldn’t agree with you more.
It’s not that I want to duplicate your web site, but I really like the design and style. Could you tell me which style are you using? Or was it tailor made?
Howdy, this is actually a blogengine weblog right? Could you take a look why it seems i can’t get any comments accepted on your weblog? I mean i am having a good read in this article and I just try to give a little postive feedback on your blogposts
I located some fascinating posts here btw.. Keep up the great work!
I am glad you said that
I’m happy that you said that post
Maybe the top thing I read all week!?
Hey Sanford, really
Ed
Hey Winifred, and pigs fly
Kind Regards
Dorothy