25 de mayo de 2007

Ejecutando codigo del shell como root.

A veces es necesario ejecutar ciertos programas como root, por ejemplo apt-get, insmod, modprobe, etc. Esto se soluciona agregando adelante sudo, sudo lo que hace es ejecutar sus parámetros como root.
Esto falla si queremos hacer algo asi como 'echo 10 > /proc/sys/root_file'. (Este caso tambien se puede resolver usando el comando tee.)
El problema es que sudo no ejecuta el shell, y por ejemplo todas las cosas interesantes que hace el shell (expansion de wildcards, redirección, etc) no son llevadas a cabo. Para hacer esto lo que hay que hacer es sudo su -c 'shell', por ejemplo sudo su -c 'echo 10 > /proc/sys/root_file'.

1 comentario:

  1. The hired developers are tasked with designing and building cutting-edge, thrilling gaming purposes for his or her on line casino customers. If in the first two playing 메리트카지노 cards dealt, the point total is eight or 9 for both the Player or the Banker, this is called a natural win and the game is over. They are completely different due to being powered by real sellers and out there just for real money. You can do it at any of the casinos talked about on this web page.

    ResponderBorrar