{"id":10832,"date":"2019-07-31T09:50:37","date_gmt":"2019-07-31T09:50:37","guid":{"rendered":"https:\/\/ittutorial.org\/?p=10832"},"modified":"2019-11-28T08:19:23","modified_gmt":"2019-11-28T08:19:23","slug":"linux-tutorial-sudoers","status":"publish","type":"post","link":"https:\/\/ittutorial.org\/linux-tutorial-sudoers\/","title":{"rendered":"Linux Tutorial &#8211; Sudoers"},"content":{"rendered":"<p>Hi everyone, today i will show you what is sudoers file and <span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">what does it do? <\/span><\/span><\/p>\n<p>W<span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">hen an authorized user creates a new user, the newly created user cannot perform certain operations<\/span><\/span> such as read or write some secret file and installation new software on operating system. <span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">Must have sudo authority for these. <\/span><\/span><\/p>\n<p>For example, i try to read \/etc\/shadow file (users password file with encrypted)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-10833\" src=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/07\/Screenshot_26-2.png\" alt=\"\" width=\"732\" height=\"170\" srcset=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/07\/Screenshot_26-2.png 624w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/07\/Screenshot_26-2-300x70.png 300w\" sizes=\"auto, (max-width: 732px) 100vw, 732px\" \/><\/p>\n<p>As you see, normal user can&#8217;t read that file because it is a very important file. After i tried to run with sudo but this time i was see <strong>oracle is not in the sudoers file.<\/strong><\/p>\n<p>It means, w<span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">e need to add oracle to sudoers file . This file is located under \/etc .\u00a0<\/span><\/span><\/p>\n<p>Loging root before edit that file.<\/p>\n<pre>su - root<\/pre>\n<pre>vi \/etc\/sudoers<\/pre>\n<p>press\u00a0 the Shift+G combination , t<span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">his will take you to the end of the file and press i for edit file.<\/span><\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10834\" src=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/07\/Screenshot_27-1.png\" alt=\"\" width=\"613\" height=\"272\" srcset=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/07\/Screenshot_27-1.png 613w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/07\/Screenshot_27-1-300x133.png 300w\" sizes=\"auto, (max-width: 613px) 100vw, 613px\" \/><\/p>\n<p><span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">Another problem<\/span><\/span> \ud83d\ude41<\/p>\n<p>File <span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">is in read-only mode, needed to change permission. Exit file with ESC -&gt; :q!\u00a0 <\/span><\/span><\/p>\n<pre>ls -l \/etc\/sudoers<\/pre>\n<pre>chmod 640 \/etc\/sudoers<\/pre>\n<pre>ls -l \/etc\/sudoers<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-10835\" src=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/07\/Screenshot_28-2.png\" alt=\"\" width=\"663\" height=\"159\" srcset=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/07\/Screenshot_28-2.png 463w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/07\/Screenshot_28-2-300x72.png 300w\" sizes=\"auto, (max-width: 663px) 100vw, 663px\" \/><\/p>\n<p>Okay seems ready for writing. Open again ,<\/p>\n<pre>vi \/etc\/sudoers<\/pre>\n<p>press\u00a0 the Shift+G combination and press i for writing.<\/p>\n<p>&nbsp;<\/p>\n<p>Add <span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">selected place with red field, you can change the user name or add other users. <\/span><\/span><\/p>\n<pre>Then, ESC -&gt; :wq for exit .<\/pre>\n<p>&nbsp;<\/p>\n<p>Now, Let&#8217;s try again<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10844\" src=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/07\/Screenshot_30-1.png\" alt=\"\" width=\"865\" height=\"360\" srcset=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/07\/Screenshot_30-1.png 865w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/07\/Screenshot_30-1-300x125.png 300w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/07\/Screenshot_30-1-768x320.png 768w\" sizes=\"auto, (max-width: 865px) 100vw, 865px\" \/><\/p>\n<p>&nbsp;<\/p>\n<pre>sudo cat \/etc\/shadow<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10845\" src=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/07\/Screenshot_33-2.png\" alt=\"\" width=\"848\" height=\"344\" srcset=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/07\/Screenshot_33-2.png 848w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/07\/Screenshot_33-2-300x122.png 300w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/07\/Screenshot_33-2-768x312.png 768w\" sizes=\"auto, (max-width: 848px) 100vw, 848px\" \/><\/p>\n<p>See, w<span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">e can now run the command that we couldn&#8217;t run before adding it to sudoers.<\/span><\/span><\/p>\n<p>See you next artical..<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<br \/>\n&nbsp;<\/p>\n<h4><span style=\"color: #ff0000;\">Do you want to learn Linux System Administration for Beginners, then read the following articles.<\/span><\/h4>\n<p><a href=\"https:\/\/ittutorial.org\/linux-administration-tutorial-for-beginners\/\">https:\/\/ittutorial.org\/linux-administration-tutorial-for-beginners\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi everyone, today i will show you what is sudoers file and what does it do? When an authorized user creates a new user, the newly created user cannot perform certain operations such as read or write some secret file and installation new software on operating system. Must have sudo authority for these. For example, &hellip;<\/p>\n","protected":false},"author":67,"featured_media":10814,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[11],"tags":[5679,4820,4819,4844,4099,4109,4826,4839,4822,198,4865,5678,4111,5658,5659,4104,5680,5690,5681,5638,4861,4855,771,5644,5656,5657,4854,5637,4102,959,4818,4843,4098,4097,4049,4828,4823,4824,5660,4094,4866,4038,4846,4092,4091,4103,4040,4827,5634,4101,5649,4105,4107,4864,4837,4055,978,4856,4852,4110,4840,4845,5632,5639,5633,4821,4858,4851,4849,4108,4829,4848,5687,5635,4096,4095,4831,2674,4093,4817,4830,4833,4832,5688,4106,4841,5648,5650,4836,5645,4853,5643,5655,5654,5653,4859,4857,5641,5640,4850,4847,5651,5652,5676,5677,5636,4863,5647,5646,4860,4862,1795,4100,1797,4034,4825,4838,4834,4835,1899,5642,5682,5686,5683,5689,5684,5685,4842],"class_list":["post-10832","post","type-post","status-publish","format-standard","has-post-thumbnail","","category-linux","tag-etc-sudoers","tag-acces-control-list","tag-acl-on-linux","tag-apt-get-on-linux","tag-bash-script","tag-beginer-on-linux","tag-best-linux-command","tag-best-text-editors-on-linux","tag-chown","tag-cok-kullanilan-linux-komutlari","tag-disk-partitioning-volume-management","tag-edit-sudoers","tag-en-cok-kullanilan-linux","tag-free-command","tag-free-command-on-linux","tag-help-kullanimi","tag-how-can-i-add-user-to-sudoers","tag-how-can-i-run-sudo-command","tag-how-i-add-sudoers","tag-htop-command","tag-htop-usage-on-linux","tag-ifconfig-linux","tag-iostat","tag-iostat-on-linux","tag-ipcs-command-on-linux","tag-ipcs-linux","tag-iptables-on-linux","tag-ksar","tag-learn-linux","tag-linux","tag-linux-acl","tag-linux-apt-get","tag-linux-bash","tag-linux-basic-commands","tag-linux-basic-documentation","tag-linux-best-practice","tag-linux-chmod","tag-linux-chown","tag-linux-command-free","tag-linux-commands","tag-linux-disk-partition-and-volume","tag-linux-documentation","tag-linux-enviroment","tag-linux-file-system-structer","tag-linux-file-system","tag-linux-help","tag-linux-help-kullanimi","tag-linux-komut-kullanimi","tag-linux-ksar","tag-linux-learn","tag-linux-lsof","tag-linux-man","tag-linux-man-kullanimi","tag-linux-monitoring","tag-linux-nano-use","tag-linux-nasil-kullanilir","tag-linux-nedir","tag-linux-network-commands","tag-linux-network-settings","tag-linux-ogrenmek","tag-linux-package-management","tag-linux-packages","tag-linux-performance-management","tag-linux-performance-monitoring","tag-linux-performance-tools","tag-linux-permission","tag-linux-process-management","tag-linux-scheduled","tag-linux-scheduled-tasks","tag-linux-scripting","tag-linux-security","tag-linux-shell","tag-linux-sudoers-file","tag-linux-sysstat","tag-linux-terminal","tag-linux-terminal-kullanimi","tag-linux-text-edstor","tag-linux-tutorial","tag-linux-tutorial-series","tag-linux-users-groups","tag-linux-users-and-groups","tag-linux-vi","tag-linux-vim","tag-linux-wheel-group","tag-linux-yardim-alma","tag-linux-yum","tag-lsof-command","tag-lsof-on-linux-command","tag-nano","tag-netstat-command","tag-network-settings-on-linux","tag-oswatcher-on-lnux","tag-performance-command-pmap","tag-pmap-comman-linux","tag-pmap-command","tag-process-management-command","tag-process-management-on-linux","tag-ps-ef-command-on-linux","tag-ps-command-on-linux","tag-schedule","tag-shell-enviroment","tag-strace-linux","tag-strace-performance-linux","tag-sudo","tag-sudoers-file","tag-sysstat","tag-sysstat-on-linux","tag-tcpdump","tag-tcpdump-using-on-linux","tag-top-command","tag-top-usage-on-linux","tag-unix","tag-unix-bash-script","tag-unix-ders-notu","tag-unix-dersleri","tag-unix-scripting","tag-use-nano-on-linux","tag-vi-on-linux","tag-vim-on-linux","tag-vmstat","tag-vmstat-on-linux","tag-what-is-sudoers","tag-wheel-group","tag-where-is-sudoers-file","tag-where-is-wheel","tag-why-sudo-command-not-found","tag-why-sudo-command-not-run","tag-yum-on-linux"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/07\/linux-hakkinda.png","jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts\/10832","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/users\/67"}],"replies":[{"embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/comments?post=10832"}],"version-history":[{"count":3,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts\/10832\/revisions"}],"predecessor-version":[{"id":13021,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts\/10832\/revisions\/13021"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/media\/10814"}],"wp:attachment":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/media?parent=10832"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/categories?post=10832"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/tags?post=10832"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}