Friday, May 8, 2009

Bagaimana RESET lupa password root

Oleh Suramya Tomar


1.0 Introduction 1,0 Pendahuluan

Suppose you have just taken over as a new system administrator from another person just before they left and they forgot to give you the root password. Now, let's say you have to install the latest version of PHP on the system so that the sales department's website works the way its supposed to. Misalnya anda sudah diambil alih sebagai administrator sistem baru dari orang lain sebelum mereka kiri dan mereka lupa untuk memberikan password root. Sekarang, mari kita berkata Anda telah menginstal versi terbaru dari PHP pada sistem sehingga penjualan dari situs web departemen bekerja dengan cara yang seharusnya. You have to get the website up yesterday, since you are losing money every minute it doesn't work. Anda harus mendapatkan website atas kemarin, sejak anda kehilangan uang setiap menit tidak bekerja. Or maybe you simply need to add another user to the system. Atau mungkin Anda hanya perlu menambahkan user ke sistem.

The above scenarios are just two possible cases when you might need to reset the root password on a system; there are hundreds of other possible cases when you might need to do this, but I am not going to list all of them. Most of us know what to do when something like this happens on a Windows machine, but not a lot of us know how to recover lost passwords from Linux machines. Skenario di atas hanyalah dua kemungkinan kasus ketika Anda mungkin perlu untuk me-reset password root pada sebuah sistem, ada ratusan kasus lain yang dapat dilakukan ketika Anda mungkin perlu melakukan ini, tetapi saya tidak akan daftar semuanya. Kebanyakan kita tahu apa yang harus dilakukan bila sesuatu seperti ini terjadi pada mesin Windows, namun tidak banyak kita tahu cara untuk mendapatkan kembali password hilang dari komputer Linux. This document attempts to rectify this situation by telling you about the different options available to recover passwords from YOUR machines. Dokumen ini berusaha untuk memperbaiki situasi ini oleh pemberitaan tentang berbagai pilihan yang tersedia untuk mendapatkan kembali password dari komputer ANDA. (Don't use this to break into other people's systems as that would be stupid and will get you into big trouble if you are caught.) (Jangan menggunakan ini untuk menarik orang lain sebagai sistem yang akan bodoh dan Anda akan mendapatkan menjadi masalah besar jika anda tertangkap.)
1,1 Disclaimer

Use the information in this document at your own risk. Menggunakan informasi dalam dokumen ini risiko Anda sendiri. I disavow any potential liability for the contents of this document. Aku menyangkal setiap potensi kewajiban untuk isi dari dokumen ini. Use of the concepts, examples, and/or other content of this document is entirely at your own risk. Menggunakan konsep, contoh, dan / atau isi dari dokumen ini adalah sepenuhnya risiko Anda sendiri.

The information in this document should only be used to recover passwords from machines to which you have legal access. Informasi dalam dokumen ini hanya boleh digunakan untuk mendapatkan kembali password dari komputer yang sudah akses hukum. If you use this information to break into other people's systems, then I am not responsible for it and you deserve your fate when you are caught. So don't blame me. Jika anda menggunakan informasi ini untuk istirahat ke dalam sistem orang lain, maka saya tidak bertanggung jawab atas hal ini dan Anda pantas nasib Anda bila Anda tertangkap. Jadi jangan salahkan saya.

You are strongly advised to make a backup of your system before performing any of the actions listed in this document. Anda sangat disarankan untuk membuat backup sistem anda sebelum melakukan tindakan apapun yang tercantum dalam dokumen ini.
1.2 Credits 1,2 Credits

In this version, I have the pleasure of acknowledging the following people without whose input this would have never seen the light of the day: Dalam versi ini, saya memiliki kesenangan yang mengakui orang-orang berikut ini tanpa masukan ini yang akan tidak pernah melihat terang hari:

* The community at http://www.justlinux.com , for the really helpful debate about this topic in one of their threads. Masyarakat di http://www.justlinux.com, benar-benar bermanfaat untuk debat tentang topik ini di salah satu topik.
* The creators and maintainers of the various Linux documentation sites using which I gathered this information. Yang menciptakan dan maintainers dari berbagai situs menggunakan Linux dokumentasi yang mengumpulkan informasi ini.
* Matt Hoskins and Kevin Walsh, for getting me interested in Linux in the first place. Matt Hoskins dan Kevin Walsh, saya tertarik untuk mendapatkan di Linux pada awalnya.
* My friends and family, for bearing with me when I was compiling this document. Teman-teman saya dan keluarga, bearing dengan saya bila saya kompilasi dokumen ini.

1.3 Before you start 1,3 Sebelum anda mulai

Before you attempt to change or replace the password of any machine, make sure you get permission from the management authorizing it, 'cause otherwise it can be mistaken as an attempt to hack into the machine, which is not good. Sebelum Anda mencoba untuk mengubah atau mengganti sandi setiap mesin, pastikan Anda mendapatkan izin dari manajemen otorisasi itu, 'penyebab lain dapat sebagai salah satu upaya untuk hack ke dalam komputer, yang tidak baik.

Secondly, create a backup of all important data before you do anything else, so if anything goes wrong you'll still have a copy of your data. Kedua, membuat cadangan dari semua data penting anda sebelum melakukan apapun, jadi jika sesuatu berjalan salah Anda masih memiliki salinan data Anda. If you didn't, and something went wrong, don't blame me. Jika anda tidak, dan sesuatu itu salah, jangan salahkan saya. I tested most of this stuff on my system and it worked, but you are responsible for your system, not me, so don't blame me if something did go wrong. Saya diuji kebanyakan hal ini pada system dan bekerja, namun Anda bertanggung jawab untuk sistem anda, bukan saya, jadi jangan salahkan saya jika ada yang bersalah.
2.1 Various Options available 2,1 Berbagai Pilihan tersedia

There are various methods available for resetting a root password. Ada berbagai metode yang tersedia untuk ulang password root. In this section, I will list all the major ones, and we will go over each in detail later in the document. Dalam bagian ini, saya akan daftar semua yang besar, dan kami akan meninjau kembali setiap detail nanti dalam dokumen. I will also go over some steps to prevent some other person from doing this and hacking your machine. Saya juga akan pergi melalui beberapa langkah untuk mencegah orang lain dari melakukan hal ini dan hacking mesin Anda.

The various methods are: Berbagai metode adalah:

* Boot into single-user mode (easiest, least risky) Boot ke single-user mode (mudah, paling tidak beresiko)
* Boot using a boot disk and edit the password file Boot menggunakan boot disk dan mengedit file password
* Mount the drive on another computer and edit the password file Mount drive di komputer lain dan mengedit file password

2.1.1 Reseting passwords by booting into single-user mode 2.1.1 Reseting sandi oleh booting ke modus single-user

This is the easiest and the fastest method to reset passwords. Ini adalah termudah dan tercepat metode untuk me-reset password. The steps are a little different depending on if you are using GRUB or LILO as a bootmanager. Langkah-langkahnya akan sedikit berbeda tergantung apakah anda menggunakan GRUB atau LILO sebagai BootManager.

Booting into single-user mode from LILO Booting ke single-user mode dari LILO

Follow these steps to reset the password when using LILO: Ikuti langkah-langkah untuk me-reset password bila menggunakan LILO:

* Reboot the system. Reboot sistem. When you see the LILO: prompt (see Fig. 1 below), type in linux single and press 'Enter'. This will log you in as root in single-user mode. Bila Anda melihat LILO: prompt (lihat Fig. 1 di bawah), ketik linux tunggal dan tekan 'Enter'. Hal ini akan anda log in sebagai root dalam modus single-user. If your system requires you to enter your root password to log in, then try linux init=/bin/bash instead. Jika sistem anda memerlukan Anda untuk memasukkan password root untuk login, kemudian coba linux init = / bin / bash instead.
* Once the system finishes booting, you will be logged in as root in single-user mode. Setelah booting sistem selesai, Anda akan login sebagai root in single-user mode. Use passwd and choose a new password for root. Passwd menggunakan dan memilih password baru untuk root.
* Type reboot to reboot the system and then you can login with the new password you just selected. Ketik reboot untuk reboot sistem dan kemudian Anda bisa login dengan password baru yang baru saja Anda pilih.

Lilo Boot Menu
Figure 1. Gambar 1. Lilo Boot Menu Lilo Boot Menu

If you have a new version of LILO which gives you a menu selection of the various kernels available press Tab to get the LILO: prompt and then proceed as shown above. Jika Anda memiliki LILO versi baru yang akan memberikan menu pilihan yang tersedia berbagai kernel tekan Tab untuk mendapatkan LILO: prompt, kemudian lanjutkan seperti yang ditunjukkan di atas.

Booting into single user mode from GRUB Booting ke mode satu pengguna dari GRUB

Follow these steps to reset the password when using GRUB: Ikuti langkah-langkah untuk me-reset password bila menggunakan GRUB:

* Reboot the system, and when you are at the selection prompt (See Fig. 2 below), highlight the line for Linux and press 'e'. Reboot sistem, dan saat Anda berada di pilihan prompt (lihat Fig. 2 di bawah), sorot baris untuk Linux dan tekan 'e'. You may only have 2 seconds to do this, so be quick. Anda mungkin hanya ada 2 detik untuk melakukan ini, jadi cepat.
* This will take you to another screen where you should select the entry that begins with 'kernel' and press 'e' again. Ini akan membawa Anda ke layar di mana Anda harus memilih entri yang diawali dengan 'kernel' dan tekan 'e' lagi.
* Append ' single' to the end of that line (without the quotes). Make sure that there is a space between what's there and 'single'. Append 'single' ke akhir baris itu (tanpa tanda kutip). Pastikan bahwa terdapat ruang antara apa yang ada dan 'single'. If your system requires you to enter your root password to log into single-user mode, then append init=/bin/bash after 'single'. Jika sistem anda memerlukan Anda untuk memasukkan password root anda masuk ke modus single-user, maka append init = / bin / bash setelah 'single'. Hit 'Enter' to save the changes. Tekan 'Enter' untuk menyimpan perubahan.
* Press 'b' to boot into Single User Mode. Tekan 'b' untuk boot ke Single Mode User.
* Once the system finishes booting, you will be logged in as root. Setelah booting sistem selesai, Anda akan login sebagai root. Use passwd and choose a new password for root. Passwd menggunakan dan memilih password baru untuk root.
* Type reboot to reboot the system, and you can login with the new password you just selected. Ketik reboot untuk reboot sistem, dan Anda dapat login dengan password baru yang baru saja Anda pilih.

Layar boot GRUB
Fig. Ara. 2: GRUB Boot Screen 2: GRUB Boot Screen
2.1.2 Reseting passwords by using a boot disk and editing the password file 2.1.2 Reseting password dengan menggunakan boot disk dan mengedit file password

This method is a little bit more complicated than the previous one and has a very high chance of success (assuming your filesystem is not encrypted and you didn't forget the password to decrypt it if it is). Metode ini sedikit lebih rumit dibandingkan dengan sebelumnya dan sangat tinggi peluang keberhasilan (asumsi Anda filesystem tidak dienkripsi dan Anda tidak lupa password mendekripnya jika itu). As before, get permission before you do this. Seperti sebelumnya, mendapatkan izin sebelum Anda melakukannya.

To start, you need a Linux boot disk or a rescue disk. Untuk memulai, Anda harus Linux boot disk atau rescue disk. (If you didn't create one when prompted during the installation then let this be a lesson for you.) You can use your installation CD as a rescue disk; most distros have an option to allow you to boot into rescue mode. (Jika Anda tidak membuat satu ketika diminta selama instalasi maka hendaklah ini menjadi pelajaran bagi kamu.) Anda dapat menggunakan CD instalasi sebagai rescue disk; paling distro-distro yang memiliki opsi untuk memungkinkan anda untuk boot ke rescue mode. With my Redhat Linux CD, I have to enter linux rescue to start the rescue mode. Redhat Linux dengan CD, saya harus memasukkan linux rescue untuk memulai rescue mode. But this might be a bit different in each distro. Tapi ini mungkin sedikit berbeda di setiap distro. You can also use a live linux CD like Knoppix or Gnoppix for system recovery. Anda juga dapat menggunakan linux live CD seperti Knoppix atau Gnoppix untuk pemulihan sistem. (Click here for a list of all the live Linux CD's). (Klik di sini untuk melihat daftar semua Linux live CD's). In this tutorial I will use Knoppix as my rescue CD but the process is almost the same for any rescue CD you might use. Dalam tutorial ini saya akan menggunakan Knoppix sebagai rescue CD namun proses ini hampir sama untuk menyelamatkan CD yang dapat digunakan.

[ You can also download one of the many single-floppy Linux distributions (eg, Tom's RootBoot [Anda juga dapat men-download salah satu dari banyak single-floppy distribusi Linux (misal, Tom RootBoot ), and use it to bring up the machine as described. ), Dan menggunakannya untuk membuka mesin seperti yang dijelaskan. This is, of course, much faster than downloading and burning a rescue CD, especially on a slow connection. Hal ini, tentu saja, jauh lebih cepat dibandingkan men-download dan membakar sebuah rescue CD, khususnya pada koneksi yang lambat. -- Ben ] - Ben]

Follow these steps to reset the password using Knoppix: Ikuti langkah-langkah untuk mengatur ulang sandi menggunakan Knoppix:

* Reboot the system and configure it to boot from the Knoppix CD (instructions available here ) Reboot sistem dan konfigurasi untuk boot dari CD Knoppix (petunjuk tersedia di sini)
* At the Knoppix Boot Prompt (See Fig. 3 below) enter: knoppix lang=us to start boot Knoppix using the english locale. Di Knoppix Boot Prompt (lihat Fig. 3 di bawah) masukkan: Knoppix lang = kami untuk mulai menggunakan boot Knoppix Inggris locale. If you understand German, feel free to just hit 'Enter' to boot into Knoppix. Jika anda memahami bahasa Jerman, silakan tekan 'Enter' untuk boot ke Knoppix.
* Once the system finishes booting, press + + (The Control, Alt and F1 key together) to switch to a virtual terminal. Setelah selesai booting sistem, tekan + + (The Control, Alt F1 kunci dan bersama-sama) untuk pindah ke virtual terminal.
* Type mkdir mountplace to create a directory called 'mountplace'. This is where we will mount the filesystem. Jenis mountplace mkdir untuk membuat direktori bernama 'mountplace'. Di sinilah kami akan me-mount filesystem.
* Type mount /dev/hdaX mountplace , where /dev/hdaX is your root partition. Ketik: mount / dev / hdaX mountplace, dimana / dev / hdaX adalah partisi root anda. More information on Linux partitions is available here . Informasi lebih lanjut tentang partisi Linux tersedia disini.
* Change to the "/etc" directory on your root partition by typing cd mountplace/etc . Ubah ke "/ etc" direktori pada partisi root anda dengan mengetikkan cd mountplace / etc.
* Use your favorite text editor and open the 'shadow' file for editing. Gunakan editor teks favorit Anda dan membuka 'bayangan' untuk mengedit file. I use 'vi', so I type vi shadow (If you have a really old system, you won't have a shadow file, in which case you need to edit the 'passwd' file.) Saya menggunakan 'vi', jadi saya ketik vi bayangan (Jika anda memiliki sistem yang sangat lama, Anda tidak akan memiliki bayangan file, dalam hal ini Anda perlu mengedit 'passwd' file.)
* Scroll down to the line containing the root user's information, which looks something like: Scroll ke arah bawah baris yang berisi informasi dari root, yang seperti:
root:dsfDSDF!s:12581:0:99999:7:::
* Delete everything between the first and second colons, so that the line looks like: Hapus semua antara colons pertama dan kedua, sehingga baris seperti:
root::12581:0:99999:7:::
* Save the file and exit your editor. Menyimpan file anda dan keluar dari editor.
* Type cd to return to your home directory. Ketik cd untuk kembali ke direktori home anda.
* Type umount mountplace to unmount the partition. Ketik umount mountplace ke-unmount partisi.
* Type reboot to reboot your system, and remove the Knoppix CD from the drive. Ketik reboot untuk reboot sistem anda, dan menghapus Knoppix dari CD drive.
* Now you can log into your system as root with no password. Sekarang Anda dapat masuk ke sistem anda sebagai root tanpa password. Make sure you change the password immediately. Pastikan Anda segera mengganti password.

Knoppix layar boot
Fig. Ara. 3: Knoppix Boot Screen 3: Knoppix Boot Screen
2.1.2 Reseting passwords by mounting on another system and editing the password file 2.1.2 Reseting sandi oleh mounting pada sistem lain dan mengedit file password

This option is a bit more work than any of the earlier options but is almost sure to work (except when the filesystem is encrypted). Pilihan ini sedikit lebih bekerja dari salah satu pilihan sebelumnya, tetapi hampir pasti bekerja (kecuali bila filesystem dienkripsi).

Follow these steps to reset the password: Ikuti langkah-langkah untuk me-reset sandi:

* Shut down the machine after backing up all important data. Shut down komputer setelah cadangan semua data penting.
* Open the casing, unplug the hard drive, and take it to another machine. (This system should be running Linux, since Windows can't read the Linux partition formats.) Membuka casing, melepaskan hard drive, dan bawa ke komputer lain. (Ini harus menjalankan sistem Linux, karena Windows tidak bisa membaca format partisi Linux.)
* Connect the hard disk as a slave drive and boot the new system. Menghubungkan harddisk sebagai slave drive dan boot sistem baru.
* Once the system finishes booting, mount the slave drive's root partition as shown above and edit the password file. Setelah selesai booting sistem, mount the slave drive's root partisi seperti yang ditunjukkan di atas dan mengedit file password.

3.1 How to Prevent someone else from reseting your root password 3,1 Cara Mencegah orang lain dari reseting password root anda

If you are an even slightly security-consious sysadmin, the previous sections must have set off alarms while you were reading them. Jika anda seorang bahkan sedikit keamanan-consious sysadmin, sebelumnya bagian harus menyalakan alarm saat Anda membacanya. Is it really that easy to hack Linux? Is it really that easy to hack Linux? Yes and No. It all it comes down to the following: Physical Access is Root Access . Yes and No Penyalahgunaan semua itu turun sebagai berikut: Fisik Akses Root Access. Meaning, if you give someone physical access to a system, then you are giving them a very good chance of getting root access on your box. This is true for Windows, Linux, or any other OS out there . Artinya, jika seseorang memberikan akses fisik ke sistem, maka Anda akan memberikan kesempatan yang sangat bagus dan mendapatkan akses root pada kotak. Hal ini berlaku untuk Windows, Linux, atau OS out there.

But... Tapi ... you say that you need to give some people physical access to the server? Anda mengatakan bahwa Anda perlu untuk memberikan beberapa orang akses fisik ke server? There are some precautions you can take to slow down attackers and stop the noob's. Ada beberapa tindakan pencegahan yang dapat Anda lakukan untuk memperlambat penyerang dan menghentikan noob's. In this section I will talk about various ways you can make your computer more secure against these types of attacks. Dalam bagian ini saya akan berbicara tentang berbagai cara untuk membuat komputer Anda lebih aman terhadap jenis serangan. So lets get started. Jadi mari kita mulai.
3.1.1 Password protecting GRUB and LILO 3.1.1 Sandi melindungi GRUB dan LILO

First, edit the /etc/inittab file and insert the following line, right after the "initdefault" line: ~~:S:wait:/sbin/sulogin . This will require a password to boot into single-user mode by making init run 'sulogin' before dropping the machine to a root shell. Pertama, edit / etc / inittab file dan masukkan baris berikut, tepat setelah "initdefault" baris: ~~:S:wait:/sbin/sulogin Ini membutuhkan password untuk boot ke modus single-user dengan membuat init menjalankan 'sulogin' sebelum mesin menurun ke shell root. 'sulogin' requires the user to input the root password before continuing. 'sulogin' mengharuskan pengguna untuk memasukkan password root sebelum melanjutkan.

Unfortunately, the above step won't protect us against people who know what they are doing and pass init=/bin/bash to the kernel at the LILO prompt. Sayangnya, langkah di atas tidak akan melindungi kita terhadap orang-orang yang tahu apa yang mereka lakukan dan lulus init = / bin / bash ke kernel pada prompt LILO. To prevent unauthorized access I would suggest that you password protect LILO/GRUB by following these steps: Untuk mencegah akses tanpa izin saya sarankan Anda melindungi password LILO / GRUB dengan mengikuti langkah berikut:

How to Protect LILO: Cara Lindungi LILO:

* Open a shell prompt and log in as root Buka shell prompt dan log in sebagai root
* Open /etc/lilo.conf in your favorite text editor Buka /etc/lilo.conf di editor teks favorit Anda
* Add the following line before the first image stanza: password= , where is your password. Tambahkan baris berikut sebelum babak pertama gambar: password= di mana adalah password.
* Run /sbin/lilo -v to let the changes take effect Menjalankan / sbin / lilo-v agar perubahan berlaku
* Type chmod 600 /etc/lilo.conf to give only root access to read and edit the file since all passwords are in plain text Ketik chmod 600 / etc / lilo.conf root hanya memberikan akses untuk membaca dan mengedit file sejak semua sandi dalam teks biasa
* Relax a bit, as your system is a little bit more secure Santai sedikit, karena sistem anda sedikit lebih aman

How to password-protect GRUB Cara untuk melindungi sandi GRUB

* Open a shell prompt and log in as root Buka shell prompt dan log in sebagai root
* Type /sbin/grub-md5-crypt and press enter Jenis / sbin/grub-md5-crypt dan tekan enter
* Enter the password you chose for GRUB when prompted. Masukkan sandi yang Anda pilih untuk GRUB ketika diminta. This will return an MD5 hash of your password Ini akan mengembalikan sebuah MD5 hash dari password
* Open /boot/grub/grub.conf in your favorite text editor Buka /boot/grub/grub.conf di editor teks favorit Anda
* Add password --md5 below the timeout in the main section (Replace with the hash you got in the previous step) Menambahkan password - md5 di bawah timeout di bagian utama ( Ganti dengan hash you got dalam langkah sebelumnya)
* Save and exit Simpan dan keluar
* The next time you reboot, the GRUB menu will not let you access the editor or command interface without first pressing [p] followed by the GRUB password. Pada saat anda reboot, GRUB menu yang tidak akan membiarkan anda mengakses editor atau antarmuka perintah pertama tanpa menekan [p] diikuti dengan password GRUB.

3.1.2 Password-protecting the BIOS Sandi-3.1.2 melindungi BIOS

There are two primary reasons for password-protecting the BIOS of a computer: Ada dua alasan utama untuk melindungi sandi BIOS dari komputer:

* Prevent Changes To BIOS Settings: if an intruder has access to the BIOS, they can set it to boot off of a diskette or CD-ROM. Untuk mencegah Perubahan Pengaturan BIOS: pengacau jika memiliki akses ke BIOS, mereka dapat mengatur untuk boot dari sebuah disket atau CD-ROM.
* Prevent Booting the System: Some BIOSes allow you to password protect the boot process itself. Mencegah Booting System: Beberapa BIOSes memungkinkan Anda untuk melindungi sandi boot proses itu sendiri. When activated, an attacker would be forced to enter a password for the BIOS to launch the boot loader. Ketika diaktifkan, penyerang yang akan dipaksa untuk memasukkan password untuk BIOS untuk memulai boot loader.

Because the methods for setting a BIOS password vary between computer manufacturers, you should consult the manual for your computer. Karena metode untuk menetapkan password BIOS bervariasi antara produsen komputer, Anda harus berkonsultasi dengan manual untuk komputer Anda. If you forget the BIOS password, it can often be reset either with jumpers on the motherboard or by disconnecting the CMOS battery. Jika Anda lupa password BIOS, ini sering bisa ulang baik dengan jumper pada motherboard atau disconnecting CMOS baterai. However, you should check the manual for your computer or motherboard before attempting this procedure. Namun, Anda harus memeriksa manual untuk komputer Anda atau motherboard ini sebelum melakukan prosedur.
4.1 Conclusion 4,1 Kesimpulan

By now I have hopefully saved you a lot of trouble by telling you how to recover your root password and make it harder for others to get the password. If you think this document helped you, or you have some comments or questions about this please feel free to Contact Me and let me know. However I must warn you that I am a somewhat lazy person who might take a little while before replying to your emails. Sekarang saya oleh kamu mudah-mudahan ada banyak kesulitan oleh cara jitu untuk memulihkan password root Anda dan membuat sulit untuk orang lain untuk mendapatkan password. Jika Anda berpikir dokumen ini membantu Anda, atau Anda memiliki komentar atau pertanyaan tentang hal ini silahkan merasa bebas Hubungi saya dan beritahu saya. Namun saya harus memperingatkan Anda bahwa saya adalah orang yang agak malas mungkin memakan waktu beberapa saat sebelum replying to your email.



No comments: