Halaman

Tampilkan postingan dengan label Debian. Tampilkan semua postingan
Tampilkan postingan dengan label Debian. Tampilkan semua postingan

Jumat, 02 Maret 2012

Forgot Debian Root Password

Here I tell you what I did
  1. Reboot server.
  2. Press downarrow key, and grub-boot loader screen appears.
  3. I select the line start with "kernel /boot/vmlinuz-2.6.26-2.686 root=/dev/sda1 ro quiet".
  4. Press 'e' to edit the argument and modify the line to: "kernel /boot/vmlinuz-2.6.26-2.686 root=/dev/sda1 rw single init=/bin/bash"
  5. Press 'b' to boot
  6. Bash prompt appears....but I was facing the problem that the keyboard did not work..(I've got error messages something like:"Device not accepting", "Unenumerate", that tell USB port not recognized)....I am using KVM Switch. I did unplug the USB keyboard from KVM Switch then plugging in another USB keyboard.
  7. After repeating steps 1-5, I was able to type using the new keyboard.
  8. I was trying using mount command such as:
#mount -n -o remount rw /
#mount -rw -o remount /
#mount -t ext3 /dev/sda1 /usr

but passwd command failed. ("bash: passwd: command not found")
(Perhaps it would works if I (re)mount rest of all my partitions in read/write (rw) mode such as /usr /var etc, but i did not do at the time).

What I did then was disabling the root password from the password file using Nano editor. I've check that the second data field in /etc/passwd is “x” for every username, so the system uses shadow passwords, and I must edit /etc/shadow.
  1. #nano /etc/shadow
I changed==> root:this_is_the_encrypted_passwd:15401:0:99999:7:::
to this ====> root::15401:0:99999:7:::
(Edit the second data field in the password file so that it is empty.)

Reboot the system and at the login prompt, type root (without password).

Rabu, 24 Maret 2010

Apache status di Debian dan BSD

1. DEBIAN
debpc:~# uname -a
Linux debpc 2.6.26-2-686 #1 SMP Wed Aug 19 06:06:52 UTC 2009 i686 GNU/Linux

debpc:~# apache2 -v
Server version: Apache/2.2.9 (Debian)Server built: Nov 14 2009 20:23:49
debpc:~# /etc/init.d/apache2 restart
Restarting web server: apache2 ... waiting .

debpc:~# ps -ef | grep apache2 | grep -v grep
root 8825 1 0 08:39 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 8832 8825 0 08:39 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 8833 8825 0 08:39 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 8834 8825 0 08:39 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 8835 8825 0 08:39 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 8836 8825 0 08:39 ? 00:00:00 /usr/sbin/apache2 -k start

debpc:~# ps ax | grep apache2 | grep -v grep
 8825 ? Ss 0:00 /usr/sbin/apache2 -k start
 8832 ? S 0:00 /usr/sbin/apache2 -k start
 8833 ? S 0:00 /usr/sbin/apache2 -k start
 8834 ? S 0:00 /usr/sbin/apache2 -k start
 8835 ? S 0:00 /usr/sbin/apache2 -k start
 8836 ? S 0:00 /usr/sbin/apache2 -k start

debpc:~# ps -ef | grep apache2 | grep -v grep| wc -l
6
debpc:~# netstat -l | grep www
tcp 0 0 192.168.70.11:www *:* LISTEN
tcp 0 0 192.168.70.10:www *:* LISTEN


2. OpenBSD
# uname -a
OpenBSD tobi.binsar.com 4.4 GENERIC#1021 i386

# httpd -v
Server version: Apache/1.3.29 (Unix)

# apachectl stop
/usr/sbin/apachectl stop: httpd stopped

# apachectl start
/usr/sbin/apachectl start: httpd started

# apachectl restart
/usr/sbin/apachectl restart: httpd restarted

# ps axu | grep httpd
www 25207 0.0 0.9 1536 2412 ?? Ss Thu10PM 0:07.98 httpd: parent
www 28902 0.0 0.7 1544 1904 ?? I Thu10PM 0:00.08 httpd: child
www 30060 0.0 0.7 1544 1868 ?? I Thu10PM 0:00.09 httpd: child
www 27591 0.0 0.7 1544 1908 ?? I Thu10PM 0:00.12 httpd: child
www 14283 0.0 0.7 1544 1920 ?? I Thu10PM 0:00.11 httpd: child
www 12608 0.0 0.7 1544 1936 ?? I Thu10PM 0:00.10 httpd: child
www 28818 0.0 0.7 1544 1872 ?? I Thu10PM 0:00.10 httpd: child
www 25051 0.0 0.7 1536 1928 ?? I Thu10PM 0:00.10 httpd: child
www 3824 0.0 0.7 1544 1876 ?? I Fri12AM 0:00.06 httpd: child
www 3047 0.0 0.7 1544 1908 ?? I Fri12AM 0:00.08 httpd: child
www 27223 0.0 0.7 1544 1932 ?? I Fri12AM 0:00.07 httpd: child


3. FreeBSD
fbdpc# uname -a
FreeBSD fbdpc.binsar.com 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Thu Jan 15 16:15:25 WIT 2009 root@fbdpc.binsar.com:/usr/src/sys/i386/compile/FERRYBSD i386

fbdpc# httpd -v
Server version: Apache/2.2.9 (FreeBSD)
Server built: Jan 9 2009 16:10:00

fbdpc# ps ax | grep httpd | grep -v grep
13007 ?? Ss 0:04.31 /usr/local/sbin/httpd -k start
13073 ?? I 0:02.68 /usr/local/sbin/httpd -k start
13074 ?? I 0:02.59 /usr/local/sbin/httpd -k start
13075 ?? I 0:02.45 /usr/local/sbin/httpd -k start
13077 ?? I 0:02.52 /usr/local/sbin/httpd -k start
13078 ?? I 0:02.54 /usr/local/sbin/httpd -k start
13098 ?? I 0:02.03 /usr/local/sbin/httpd -k start
32289 ?? I 0:01.79 /usr/local/sbin/httpd -k start
32290 ?? I 0:01.75 /usr/local/sbin/httpd -k start
32291 ?? I 0:01.66 /usr/local/sbin/httpd -k start
32599 ?? I 0:01.29 /usr/local/sbin/httpd -k start