Cara Menyembunyikan Proses Dari User Default atau Non-Root

by | Mar 25, 2024 | Blog, Linux, Tips and Trick, Tutorial | 21 comments

Jika Anda mengelola sebuah server atau sistem Linux multi-pengguna, secara default semua pengguna, termasuk pengguna biasa, dapat melihat proses yang sedang berjalan, termasuk proses yang dijalankan oleh pengguna root dan sistem. Namun, pada server yang penting untuk keamanan, Anda mungkin ingin menyembunyikan proses dari pengguna normal.

Perilaku default ini tidak dianggap baik dari sudut pandang keamanan, karena semua pengguna dapat melihat semua proses, termasuk yang dimiliki oleh pengguna “root”.

Anda mungkin ingin mengetahui cara menyembunyikan proses Linux dari pengguna biasa, terutama untuk menyembunyikan proses yang dijalankan oleh pengguna “root”.

 

 

Cara Menyembunyikan Proses dari User Normal/Default

cara-menjalankan-bash

Jika Anda mencari di direktori /proc pada sistem Linux, Anda akan menemukan banyak file dan direktori, dimana banyak di antaranya hanya berupa angka yang mewakili informasi tentang ID proses (PID) tertentu.

Secara default, sistem Linux dikonfigurasi untuk memungkinkan semua pengguna lokal melihat semua informasi ini, termasuk informasi proses dari pengguna lain. Namun, ini dapat menjadi masalah keamanan karena informasi sensitif dapat terbuka untuk pengguna yang tidak seharusnya. Dengan melakukan beberapa penyesuaian pada konfigurasi sistem file, kita dapat mengubah perilaku ini dan meningkatkan keamanan sistem.

Jika Anda menjalankan kernel Linux yang lebih baru (versi 3.2 atau lebih tinggi), Anda dapat memanfaatkan fitur baru yaitu opsi hidepid dalam sistem file /proc.

Pemahaman /proc

Sistem file proc adalah sistem file semu yang memberikan akses ke struktur data kernel. Biasanya dipasang di /proc dan secara otomatis disertakan oleh sistem, meskipun juga bisa dipasang secara manual menggunakan perintah mount.

Kebanyakan file dalam sistem file proc hanya dapat dibaca (read-only), tetapi beberapa file dapat ditulis, memungkinkan pengguna untuk mengubah variabel kernel.

Secara default, pengaturan hidepid adalah 0, yang memperlihatkan perilaku default. Dengan nilai ini, pengguna biasa dapat melihat semua proses yang berjalan di sistem, termasuk proses dari pengguna lain dan pengguna root.

Namun, Anda bisa mengatur hidepid ke 1 atau 2 untuk menyembunyikan informasi proses dari pengguna biasa. Dengan hidepid=1, pengguna biasa hanya dapat melihat proses mereka sendiri dengan perintah seperti ps dan top, meskipun ID proses masih dapat dilihat di /proc. Dengan hidepid=2, pengguna hanya dapat melihat proses mereka sendiri, dan ID proses dari pengguna lain juga disembunyikan di /proc.

Sekarang, mari kita pasang kembali sistem file proc dengan opsi hidepid=2. Dengan demikian, pengguna biasa tidak akan memiliki akses untuk melihat proses pengguna lain, termasuk proses dari pengguna root. Ini merupakan langkah yang penting untuk meningkatkan keamanan pada server Linux.

cara-menyembunyikan-proses

Setelah penyelesaian proses, pengguna biasa (dalam kasus ini, pengguna alok) tidak akan memiliki kemampuan untuk melihat proses yang dimiliki oleh pengguna lain dan pengguna root.

Tentunya, Anda dapat membuat perubahan tersebut permanen dengan mengedit file /etc/fstab untuk menyertakan entri yang sesuai.

proc /proc proc defaults,hidepid=2 0 0

Sekarang, ketika pengguna biasa, alok, mencoba menggunakan perintah top dan ps lagi, dia hanya akan dapat melihat proses yang dimilikinya sendiri. Dengan demikian, kita telah berhasil menyembunyikan proses dari pengguna normal.

cara-menyembunyikan-proses

Jika anda menggunakan systemD, anda harus membuat layanan untuk skrip misalnya sync.sh anda, file ini akan menjadi:

/lib/systemd/system/sync.service

Anda dapat mengedit file ini (dengan hak ‘root’ atau ‘sudo’) sehingga berisi:

 

[Unit]
Description=My Shell Script for Sync

[Service]
ExecStart=/usr/bin/sync.sh

[Install]
WantedBy=multi-user.target

 

Kemudian, anda memuat ulang daemon systemD anda (sehingga ia mengetahui bahwa layanan telah ditambahkan):

sudo systemctl daemon-reload

Kemudian anda dapat mengaktifkan layanan anda (sehingga akan diluncurkan pada setiap permulaan sistem:

sudo systemctl enable sync.service

Kemudian anda dapat memulainya secara manual sehingga akan langsung dimulai, tanpa menunggu sistem restart berikutnya :

sudo systemctl start sync.service

Dan tentu saja, anda dapat mengubah nama layanan anda sesuai keinginan anda.

pengguna normal tidak dapat melihat proses oleh pengguna lain dan pengguna root

21 Comments

  1. qweqttt

    hiI like your writing so much share we be in contact more approximately your article on AOL I need a specialist in this area to resolve my problem Maybe that is you Looking ahead to see you

    Reply
  2. acheteriptvabonnement

    I do believe all the ideas youve presented for your post They are really convincing and will certainly work Nonetheless the posts are too short for novices May just you please lengthen them a little from subsequent time Thanks for the post

    Reply
  3. temp mail

    You appear to be able to read my thoughts. It’s as though you authored the book on this subject or something. You seem to know so much about it. I think a few graphics could help to emphasise the point a little bit more, but other than that, this is a terrific blog, and I will surely be back.

    Reply
  4. itsrider

    Fantastic site Lots of helpful information here I am sending it to some friends ans additionally sharing in delicious And of course thanks for your effort

    Reply
  5. Best IP TV Services

    I have been browsing online more than three hours today yet I never found any interesting article like yours It is pretty worth enough for me In my view if all website owners and bloggers made good content as you did the internet will be a lot more useful than ever before

    Reply
  6. zoritoler imol

    Magnificent items from you, man. I have understand your stuff prior to and you’re simply too great. I actually like what you have obtained here, really like what you are saying and the way in which through which you say it. You are making it enjoyable and you continue to care for to keep it smart. I cant wait to learn far more from you. That is really a great site.

    Reply
  7. insightsway

    Fantastic beat I would like to apprentice while you amend your web site how could i subscribe for a blog site The account helped me a acceptable deal I had been a little bit acquainted of this your broadcast offered bright clear concept

    Reply
  8. floatswitchs

    Normally I do not read article on blogs however I would like to say that this writeup very forced me to try and do so Your writing style has been amazed me Thanks quite great post

    Reply
  9. cuddlechair

    Nice blog here Also your site loads up fast What host are you using Can I get your affiliate link to your host I wish my web site loaded up as quickly as yours lol

    Reply
  10. webech

    you are in reality a just right webmaster The site loading velocity is incredible It seems that you are doing any unique trick In addition The contents are masterwork you have performed a wonderful task on this topic

    Reply
  11. etruesports

    I have been browsing online more than three hours today yet I never found any interesting article like yours It is pretty worth enough for me In my view if all website owners and bloggers made good content as you did the internet will be a lot more useful than ever before

    Reply
  12. Caça-níqueis grátis

    Ive read several just right stuff here Certainly price bookmarking for revisiting I wonder how a lot effort you place to create this kind of great informative website

    Reply
  13. Jogos de caça-níqueis

    Eu li várias coisas certas aqui Certamente vale a pena marcar como favorito para revisitar. Eu me pergunto quanto esforço você faz para criar esse tipo de site informativo excelente

    Reply
  14. itsreleased

    Usually I do not read article on blogs however I would like to say that this writeup very compelled me to take a look at and do it Your writing style has been amazed me Thank you very nice article

    Reply
  15. itsreleased

    Hello i think that i saw you visited my weblog so i came to Return the favore Im trying to find things to improve my web siteI suppose its ok to use some of your ideas

    Reply
  16. twinklecrest

    helloI really like your writing so a lot share we keep up a correspondence extra approximately your post on AOL I need an expert in this house to unravel my problem May be that is you Taking a look ahead to see you

    Reply
  17. businesstrick

    Nice blog here Also your site loads up fast What host are you using Can I get your affiliate link to your host I wish my web site loaded up as quickly as yours lol

    Reply
  18. bestiptv smarters

    obviously like your website but you need to test the spelling on quite a few of your posts Several of them are rife with spelling problems and I to find it very troublesome to inform the reality on the other hand Ill certainly come back again

    Reply
  19. freeskyguide

    Excellent blog here Also your website loads up very fast What web host are you using Can I get your affiliate link to your host I wish my web site loaded up as quickly as yours lol

    Reply
  20. airticketing

    Hi Neat post Theres an issue together with your web site in internet explorer may test this IE still is the marketplace chief and a good component of people will pass over your fantastic writing due to this problem

    Reply
  21. hdhub4uin

    Somebody essentially help to make significantly articles Id state This is the first time I frequented your web page and up to now I surprised with the research you made to make this actual post incredible Fantastic job

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Cari

Kategori Artikel