{"id":1239,"date":"2020-11-30T19:10:36","date_gmt":"2020-12-01T00:10:36","guid":{"rendered":"https:\/\/truxgoservers.com\/blog\/?p=1239"},"modified":"2020-11-30T19:10:38","modified_gmt":"2020-12-01T00:10:38","slug":"security-commands-on-linux-that-you-should-know","status":"publish","type":"post","link":"https:\/\/truxgoservers.com\/blog\/security-commands-on-linux-that-you-should-know\/","title":{"rendered":"Security Commands on Linux that you should know"},"content":{"rendered":"\n<p>If you are taking care of the security of Linux systems, it is important that you know these commands and know how each of these helps you and works. There are many aspects of security on Linux systems, from setting up accounts to ensuring that legitimate users do not have more privileges than they need to do their jobs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Security Commands<\/h2>\n\n\n\n<p><strong><em>\u25b8Sudo<\/em><\/strong><\/p>\n\n\n\n<p>Running privileged commands with sudo &#8211; rather than switching from user to root &#8211; is an essential good practice, as it helps ensure that root privilege is only used when necessary and limits the impact of errors. Your access to the sudo command depends on the configuration of the \/ etc \/ sudoers and \/ etc \/ group files.<\/p>\n\n\n\n<p><strong><em>\u25b8Who and w<\/em><\/strong><\/p>\n\n\n\n<p>The who and w commands show you who is logged in to the system, although w shows more information, such as where the session was started from, when it was started, and how long it was inactive.<\/p>\n\n\n\n<p><strong><em>\u25b8Find<\/em><\/strong><\/p>\n\n\n\n<p>The find command is used for many types of searches. When it comes to security, you might be looking for files that don&#8217;t have owners (or corresponding accounts) or that are writable and executable for everyone. The find commands are easy to compose but require some familiarity with their many options to define what to look for.<\/p>\n\n\n\n<p><strong><em>\u25b8Which<\/em><\/strong><\/p>\n\n\n\n<p>The which command identifies the executable that will run when you type its name. This will not always be what you think it is. If a Trojan has inserted itself into the file system at a location that appears in the search path before the legitimate one, it will run instead. This is a good reason to make sure your search path includes directories like \/ usr \/ bin before adding fewer standard locations and especially before the &#8220;.&#8221; (current directory) even if necessary suedes to check the search path of a user by changing the user and making him (echo).<\/p>\n\n\n\n<p><strong><em>\u25b8IPTables<\/em><\/strong><\/p>\n\n\n\n<p>It is also important to know how to list the firewall rules for iptables. These commands will provide you with a complete list of netfilter rules:<\/p>\n\n\n\n<p><strong><em>\u25b8Kill, Pkill and Killall<\/em><\/strong><\/p>\n\n\n\n<p>As you can see in &#8220;More than one way to kill a Unix process&#8221;, Unix and Linux systems offer a convenient selection of commands to kill processes no matter why you want them dead. You can kill by process ID or by name. You can kill individually or in a group. In any case, the various kill commands are at your disposal and you should be ready to use them when necessary.<\/p>\n\n\n\n<p><strong><em>\u25b8Visudo<\/em><\/strong><\/p>\n\n\n\n<p>The visudo command allows you to make changes to the \/ etc \/ sudoers file by opening the file in a text editor and checking the syntax of the changes. Run the command with &#8220;sudo visudo&#8221; and make sure you understand the syntax. Privileges can be assigned by user or by group. On most Linux systems, the \/ etc \/ sudoers file will already be configured with groups like the ones shown below that allow you to assign privileges to the groups configured in the \/ etc \/ group file.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are taking care of the security of Linux systems, it is important that you know these commands and know how each of these helps you and works. There are many aspects of security on Linux systems, from setting up accounts to ensuring that legitimate users do not have more privileges than they need [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1240,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,3],"tags":[94,36,27],"class_list":["post-1239","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cybersecurity","category-linux","tag-commands","tag-cybersecurity","tag-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Security Commands on Linux that you should know - Truxgo Server Blog<\/title>\n<meta name=\"description\" content=\"In Linux there are commands that can facilitate the security of our system and we see some of these that can help us to improve our security.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/truxgoservers.com\/blog\/security-commands-on-linux-that-you-should-know\/\" \/>\n<meta property=\"og:locale\" content=\"es_MX\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Security Commands on Linux that you should know - Truxgo Server Blog\" \/>\n<meta property=\"og:description\" content=\"In Linux there are commands that can facilitate the security of our system and we see some of these that can help us to improve our security.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/truxgoservers.com\/blog\/security-commands-on-linux-that-you-should-know\/\" \/>\n<meta property=\"og:site_name\" content=\"Truxgo Server Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-12-01T00:10:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-12-01T00:10:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/truxgoservers.com\/blog\/wp-content\/uploads\/2020\/11\/Linux-segg.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"500\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Truxgo\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Truxgo\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/security-commands-on-linux-that-you-should-know\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/security-commands-on-linux-that-you-should-know\\\/\"},\"author\":{\"name\":\"Truxgo\",\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/#\\\/schema\\\/person\\\/8b409c26449db6aa09724b45331e333e\"},\"headline\":\"Security Commands on Linux that you should know\",\"datePublished\":\"2020-12-01T00:10:36+00:00\",\"dateModified\":\"2020-12-01T00:10:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/security-commands-on-linux-that-you-should-know\\\/\"},\"wordCount\":511,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/security-commands-on-linux-that-you-should-know\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/Linux-segg.jpg\",\"keywords\":[\"Commands\",\"Cybersecurity\",\"Linux\"],\"articleSection\":[\"Cybersecurity\",\"Linux\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/security-commands-on-linux-that-you-should-know\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/security-commands-on-linux-that-you-should-know\\\/\",\"url\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/security-commands-on-linux-that-you-should-know\\\/\",\"name\":\"Security Commands on Linux that you should know - Truxgo Server Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/security-commands-on-linux-that-you-should-know\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/security-commands-on-linux-that-you-should-know\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/Linux-segg.jpg\",\"datePublished\":\"2020-12-01T00:10:36+00:00\",\"dateModified\":\"2020-12-01T00:10:38+00:00\",\"description\":\"In Linux there are commands that can facilitate the security of our system and we see some of these that can help us to improve our security.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/security-commands-on-linux-that-you-should-know\\\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/security-commands-on-linux-that-you-should-know\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/security-commands-on-linux-that-you-should-know\\\/#primaryimage\",\"url\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/Linux-segg.jpg\",\"contentUrl\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/Linux-segg.jpg\",\"width\":800,\"height\":500},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/security-commands-on-linux-that-you-should-know\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Security Commands on Linux that you should know\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/\",\"name\":\"Truxgo Server Blog\",\"description\":\"Cloud Server and Hosting Tutorials.\",\"publisher\":{\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"es\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/#organization\",\"name\":\"Truxgo Server Blog\",\"url\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/cropped-truxgo-logo-blanco.png\",\"contentUrl\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/cropped-truxgo-logo-blanco.png\",\"width\":1250,\"height\":278,\"caption\":\"Truxgo Server Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/#\\\/schema\\\/person\\\/8b409c26449db6aa09724b45331e333e\",\"name\":\"Truxgo\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/52691a61c58e68677ed4860007c1bb03b14eabe7350747ab3fad3e17825b4b96?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/52691a61c58e68677ed4860007c1bb03b14eabe7350747ab3fad3e17825b4b96?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/52691a61c58e68677ed4860007c1bb03b14eabe7350747ab3fad3e17825b4b96?s=96&d=mm&r=g\",\"caption\":\"Truxgo\"},\"sameAs\":[\"https:\\\/\\\/truxgoservers.com\\\/blog\"],\"url\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/author\\\/truxgo\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Security Commands on Linux that you should know - Truxgo Server Blog","description":"In Linux there are commands that can facilitate the security of our system and we see some of these that can help us to improve our security.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/truxgoservers.com\/blog\/security-commands-on-linux-that-you-should-know\/","og_locale":"es_MX","og_type":"article","og_title":"Security Commands on Linux that you should know - Truxgo Server Blog","og_description":"In Linux there are commands that can facilitate the security of our system and we see some of these that can help us to improve our security.","og_url":"https:\/\/truxgoservers.com\/blog\/security-commands-on-linux-that-you-should-know\/","og_site_name":"Truxgo Server Blog","article_published_time":"2020-12-01T00:10:36+00:00","article_modified_time":"2020-12-01T00:10:38+00:00","og_image":[{"width":800,"height":500,"url":"https:\/\/truxgoservers.com\/blog\/wp-content\/uploads\/2020\/11\/Linux-segg.jpg","type":"image\/jpeg"}],"author":"Truxgo","twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"Truxgo","Tiempo de lectura":"3 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/truxgoservers.com\/blog\/security-commands-on-linux-that-you-should-know\/#article","isPartOf":{"@id":"https:\/\/truxgoservers.com\/blog\/security-commands-on-linux-that-you-should-know\/"},"author":{"name":"Truxgo","@id":"https:\/\/truxgoservers.com\/blog\/#\/schema\/person\/8b409c26449db6aa09724b45331e333e"},"headline":"Security Commands on Linux that you should know","datePublished":"2020-12-01T00:10:36+00:00","dateModified":"2020-12-01T00:10:38+00:00","mainEntityOfPage":{"@id":"https:\/\/truxgoservers.com\/blog\/security-commands-on-linux-that-you-should-know\/"},"wordCount":511,"commentCount":1,"publisher":{"@id":"https:\/\/truxgoservers.com\/blog\/#organization"},"image":{"@id":"https:\/\/truxgoservers.com\/blog\/security-commands-on-linux-that-you-should-know\/#primaryimage"},"thumbnailUrl":"https:\/\/truxgoservers.com\/blog\/wp-content\/uploads\/2020\/11\/Linux-segg.jpg","keywords":["Commands","Cybersecurity","Linux"],"articleSection":["Cybersecurity","Linux"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/truxgoservers.com\/blog\/security-commands-on-linux-that-you-should-know\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/truxgoservers.com\/blog\/security-commands-on-linux-that-you-should-know\/","url":"https:\/\/truxgoservers.com\/blog\/security-commands-on-linux-that-you-should-know\/","name":"Security Commands on Linux that you should know - Truxgo Server Blog","isPartOf":{"@id":"https:\/\/truxgoservers.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/truxgoservers.com\/blog\/security-commands-on-linux-that-you-should-know\/#primaryimage"},"image":{"@id":"https:\/\/truxgoservers.com\/blog\/security-commands-on-linux-that-you-should-know\/#primaryimage"},"thumbnailUrl":"https:\/\/truxgoservers.com\/blog\/wp-content\/uploads\/2020\/11\/Linux-segg.jpg","datePublished":"2020-12-01T00:10:36+00:00","dateModified":"2020-12-01T00:10:38+00:00","description":"In Linux there are commands that can facilitate the security of our system and we see some of these that can help us to improve our security.","breadcrumb":{"@id":"https:\/\/truxgoservers.com\/blog\/security-commands-on-linux-that-you-should-know\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/truxgoservers.com\/blog\/security-commands-on-linux-that-you-should-know\/"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/truxgoservers.com\/blog\/security-commands-on-linux-that-you-should-know\/#primaryimage","url":"https:\/\/truxgoservers.com\/blog\/wp-content\/uploads\/2020\/11\/Linux-segg.jpg","contentUrl":"https:\/\/truxgoservers.com\/blog\/wp-content\/uploads\/2020\/11\/Linux-segg.jpg","width":800,"height":500},{"@type":"BreadcrumbList","@id":"https:\/\/truxgoservers.com\/blog\/security-commands-on-linux-that-you-should-know\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/truxgoservers.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Security Commands on Linux that you should know"}]},{"@type":"WebSite","@id":"https:\/\/truxgoservers.com\/blog\/#website","url":"https:\/\/truxgoservers.com\/blog\/","name":"Truxgo Server Blog","description":"Cloud Server and Hosting Tutorials.","publisher":{"@id":"https:\/\/truxgoservers.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/truxgoservers.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"es"},{"@type":"Organization","@id":"https:\/\/truxgoservers.com\/blog\/#organization","name":"Truxgo Server Blog","url":"https:\/\/truxgoservers.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/truxgoservers.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/truxgoservers.com\/blog\/wp-content\/uploads\/2020\/08\/cropped-truxgo-logo-blanco.png","contentUrl":"https:\/\/truxgoservers.com\/blog\/wp-content\/uploads\/2020\/08\/cropped-truxgo-logo-blanco.png","width":1250,"height":278,"caption":"Truxgo Server Blog"},"image":{"@id":"https:\/\/truxgoservers.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/truxgoservers.com\/blog\/#\/schema\/person\/8b409c26449db6aa09724b45331e333e","name":"Truxgo","image":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/secure.gravatar.com\/avatar\/52691a61c58e68677ed4860007c1bb03b14eabe7350747ab3fad3e17825b4b96?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/52691a61c58e68677ed4860007c1bb03b14eabe7350747ab3fad3e17825b4b96?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/52691a61c58e68677ed4860007c1bb03b14eabe7350747ab3fad3e17825b4b96?s=96&d=mm&r=g","caption":"Truxgo"},"sameAs":["https:\/\/truxgoservers.com\/blog"],"url":"https:\/\/truxgoservers.com\/blog\/author\/truxgo\/"}]}},"_links":{"self":[{"href":"https:\/\/truxgoservers.com\/blog\/wp-json\/wp\/v2\/posts\/1239","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/truxgoservers.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/truxgoservers.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/truxgoservers.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/truxgoservers.com\/blog\/wp-json\/wp\/v2\/comments?post=1239"}],"version-history":[{"count":1,"href":"https:\/\/truxgoservers.com\/blog\/wp-json\/wp\/v2\/posts\/1239\/revisions"}],"predecessor-version":[{"id":1241,"href":"https:\/\/truxgoservers.com\/blog\/wp-json\/wp\/v2\/posts\/1239\/revisions\/1241"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/truxgoservers.com\/blog\/wp-json\/wp\/v2\/media\/1240"}],"wp:attachment":[{"href":"https:\/\/truxgoservers.com\/blog\/wp-json\/wp\/v2\/media?parent=1239"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/truxgoservers.com\/blog\/wp-json\/wp\/v2\/categories?post=1239"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/truxgoservers.com\/blog\/wp-json\/wp\/v2\/tags?post=1239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}