{
  "schemaVersion": 1,
  "id": "texto-usuarios-y-permisos-en-gnu-linux",
  "language": "en",
  "canonical": "https://paynalton.tech/en/works/usuarios-y-permisos-en-gnu-linux/",
  "title": "Users and permissions in GNU/Linux",
  "summary": "An explanation of users, permissions, and console conventions.",
  "author": "Paynalton",
  "format": "technical",
  "year": 2009,
  "source": "https://paynalton.blogspot.com/2009/01/untitled_12.html",
  "partial": false,
  "topics": [
    {
      "title": "Technical texts",
      "url": "https://paynalton.tech/en/topics/lectura-categoria-tecnicos/"
    },
    {
      "title": "Technical text",
      "url": "https://paynalton.tech/en/topics/lectura-texto-tecnico/"
    },
    {
      "title": "Tutorial",
      "url": "https://paynalton.tech/en/topics/lectura-tutorial/"
    },
    {
      "title": "GNU/Linux",
      "url": "https://paynalton.tech/en/topics/lectura-gnu-linux/"
    },
    {
      "title": "Cybersecurity",
      "url": "https://paynalton.tech/en/topics/lectura-seguridad-informatica/"
    }
  ],
  "body": "<br><br><br><br><br>This is something that many new users find confusing...<br><br>Many times they will see manuals and messages that look like this:<br><br>\n\n<div>\n\nCode:\n\n</div>\n\n<div>\n\n```\n$ls todo\n\n#apt-get install miprograma\n```\n\n</div>\n\n<br><br>And they don't take into account the first character.<br><br>Linux<br>is a pretty secure system because most things are done in<br>user mode, so what we do in this mode will never damage<br>the system (unless we have done very stupid things before,<br>such as changing permissions on important files and<br>directories).<br><br>When in a manual or instruction we indicate that<br>a command should be used in user mode, we use the character \"\\$\" at the<br>beginning of the line, for example:<br><br>\n\n<div>\n\nCode:\n\n</div>\n\n<div>\n\n```\n$mkdir nuevacarpeta\n$rm archivodeprueva\n$ls *\n```\n\n</div>\n\n<br>In contrast, when we need to run a command as administrator, we indicate it with the character \"#\", for example:<br><br>\n\n<div>\n\nCode:\n\n</div>\n\n<div>\n\n```\n#apt-get install loquesea\n#nano /etc/archivo.conf\n#rm -r /*\n```\n\n</div>\n\n**Recommendations:**<br><br>For<br>the safety of their equipment, when they go to run a command as<br>administrator, start the session, execute what they need to execute,<br>and return immediately to user mode, this will save them from making an<br>error that could be fatal to the system.<br><br>**Switching between user mode and Administrator:**<br><br>In Linux there will always be more than one way to do things.<br><br>The<br>most common option to run a command is to open a virtual console (some<br>program within the graphical environment that shows us the command line in<br>the purest MS-DOS style). and execute commands. When opening it, we will<br>see something like:<br><br>\n\n<div>\n\nCode:\n\n</div>\n\n<div>\n\n```\npaynalton@Carlos-Internet:~$\n```\n\n</div>\n\nAs<br>you can see, the \"\\$\" indicates that we are in user mode. To be more<br>specific, the PROMPT is structured as follows:<br><br>\n\n<div>\n\nCode:\n\n</div>\n\n<div>\n\n```\npaynalton                  @       Carlos-Internet      :   ~                       $\nNombreDelUsuario     @       NombreDelEquipo  :   DirectorioActual   MODO\n```\n\n</div>\n\nTo switch to administrator mode we use the command \"su\"<br><br>\n\n<div>\n\nCode:\n\n</div>\n\n<div>\n\n```\npaynalton@intraasm:~$ su\nPassword:\nintraasm:/var/www/nuevaintra#\n```\n\n</div>\n\n<br>As<br>ven changes the final character to a \"#\" indicating that we are in<br>administrator mode, to return to the previous mode simply use the<br>command \"exit\"<br><br>\n\n<div>\n\nCode:\n\n</div>\n\n<div>\n\n```\npaynalton@intraasm:~$ su\nPassword:\nintraasm:/var/www/nuevaintra# exit\nexit\npaynalton@intraasm:~$    \n```\n\n</div>\n\n<br>Thus, you will always return to the previous user.<br><br>Some<br>systems, for security reasons, do not allow you to use the \"su\" command (Ubuntu<br>and all its derivatives), but instead come with another quite useful and secure<br>command: \"sudo\" (stand in for superuser). This command will allow you to<br>execute commands as if you were the administrator, but without fully opening the<br>session, so that you do not need to use the \"exit\" command.<br><br>Therefore, if in a manual you see something like:<br>\n\n<div>\n\nCode:\n\n</div>\n\n<div>\n\n```\n$./config\n$./make\n#./make install\n```\n\n</div>\n\n<br>it is the same as if you execute:<br><br><br>\n\n<div>\n\nCode:\n\n</div>\n\n<div>\n\n```\npaynalton@intraasm:~$./config\npaynalton@intraasm:~$./make\npaynalton@intraasm:~$su\nPassword:\nintraasm:/var/www/nuevaintra#./make install\nintraasm:/var/www/nuevaintra# exit\nexit\npaynalton@intraasm:~$  \n```\n\n</div>\n\n <br><br>and<br><br>\n\n<div>\n\nCode:\n\n</div>\n\n<div>\n\n```\npaynalton@Carlos-Internet:~$./config\npaynalton@Carlos-Internet:~$./make\npaynalton@Carlos-Internet:~$ sudo ./make install\n[sudo] password for paynalton:\npaynalton@Carlos-Internet:~$\n```\n\n</div>\n\n<br><br>And I think that's all for this brief clarification, I hope it is useful to you.<br><br>If you wish to know more about the commands mentioned here, do not forget to check the manuals by typing in your console:<br>\n\n<div>\n\nCode:\n\n</div>\n\n<div>\n\n```\n$man comando\n```\n\n</div>\n\n<br>\n"
}
