¡Para tratar de prevenir, la eliminación de una carpeta por error con miles de archivos, pues cambié el propietario a root! Esto puede ser muy sencillo pero a la vez peligroso, lo mejor es investigar sobre los comandos y hacer una práctica inofensiva.
La mejor manera es:
1. Ingresar como súper-usuario a la terminal
2. Cambiar el propietario:
chown -fR root:root /ruta/carpeta
3. "Asignar nuevamente el propietario" a usted:
chown -fR usuario:users /ruta/carpeta/
⚠️OBSERVE la raya al final, con ella incluimos todo lo que hay adentro de la carpeta "probando" -en este ejemplo-; podemos ver/leer, crear y eliminar archivos o carpetas, pero no podemos eliminar el directorio "Padre/Madre".
Usted es propietario tiene permisos sobre el contenido que hay ahí, nada más, no puede ni siquiera mover la carpeta "probando" a otra parte.
Ahora bien, si queremos por ejemplo, crear una carpeta adentro de probando y protegerla también, tendríamos que repetir el proceso:
//hacer al root dueño de la carpeta
chown -fR root:root /home/usuario/probando/videos
//volver a convertirse en dueño
chown -fR usuario:users /home/usuario/probando/videos/
FINALMENTE tenemos una carpeta o directorio "probando", que no podemos mover o eliminar, pero que dentro de él tenemos permisos para: crear, guardar archivos o moverlos y borrarlos; también un directorio nuevo adentro, que es la excepción ahora "videos", pero si ingresamos adentro de "videos" no tenemos restricciones.
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
✓ Live Streaming✓ Interactive Chat✓ Private Shows✓ HD Quality✓ Free Actions
Free to watch • No registration required • HD streaming
Essta funcion nos permite establecer al propietario de un archivo en nuestro equipo. Espero les sea de utilidad!
Bienvenidos sean a este post, hoy veremos una funcion de PHP.
Esta funcion nos permite modificar el usuario o dueño de un archivo. Veamos como es su sintaxis:
chown(archivo, usuario);
El primer argumento sera el archivo que modificaremos y el segundo sera el nuevo dueño. Podemos pasar tanto el nombre del usuario como el uuid. Nos devolvera un valor booleano para indicar si fue exitoso, true, y…
If you've stumbled upon this post, it most likely means that you're trying to fix a nasty issue affecting your Linux server: every time you upload some new files to a folder (such as var/www) that has specific group access (such as www-data) using your favorite SSH or FTP(s) client, those files are created with : ownership rights - instead of :www-data permissions like you would like to.Such behavior basically prevents Apache, NGINX, and any other service that is configured to use www-data permissions from accessing those files, as well as other users different than you, until you use chown/chgrp commands to fix it.Is there a way to specify a default group when creating new files, instead of using your username's group? As a matter of fact, the answer is YES. In this post, we'll see how we can do that.How to Set a Default Group for new FilesHere's what we need to do to set a default group when adding new files in a folder:chgrp www-data /var/wwwchmod g+s /var/wwwOnce we do that, all existing and new files created in the /var/www directory will be owned by the www-data group. More precisely, the first command will change the current permissions for the existing files, while the latter will set the default behavior for new files. Needless to say, if the folder(s) are already owned by the www-data group, we can omit the first command and just set the default behavior for all new files.However, it's worth noting that the above commands will only change the behavior of the root /var/www folder - not the sub-folders within it. If we want to apply the same behavior for the whole directory tree - the /var/www folder and all subfolders - we need to execute a recursive approach using the find command in the following way:find /var/www -type d -exec chgrp www-data {} +find /var/www -type d -exec chmod g+s {} +That's it.ConclusionsWe hope that this small piece of advice will help other system administrators getting rid of this nasty "ownership issue" as well.
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
✓ Live Streaming✓ Interactive Chat✓ Private Shows✓ HD Quality✓ Free Actions
Free to watch • No registration required • HD streaming
How to fix SU authentication failure and Sudo: Permission denied Prompt in Ubuntu
How to fix SU authentication failure and Sudo: Permission denied Prompt in Ubuntu
In this short guide, you will learn how to fix the Su: Authentication Failure in Linux. With this error, you will also encounter the Permission denied message when trying to carry out any installation with sudo permission. In Linux, there are different types of users, and sudo or the root user is one of such users but a user with the full permission to execute any command in Linux. Sudo means…