Lupa password admin mikrotik…?
Wah bisa bahaya juga ya … padahal back up setingan sudah lupa naruh, apalagi dead line harus selesai, weh weh… telusur dan telusur akhirnya dapat tutorial mantap nech, tapi sayang pake nya perl… gak masalah untuk coba kenalan lagi ama perl.
yuk mari…
berikut script asli yang saya dapat dari http://blog.butchevans.com
First, the code:
#!/usr/bin/perl
# Update multiple mikrotiks
# change password script
# Copyright (C) 2004 Butch Evans
# [email protected]
#########################
# Configuration section #
#########################
# The username and password file with connection information
# to connect to your router. This user MUST have read and write permissions
# Each line in this file is in the format:
# routerip::user::userpassword
my $passwdfile = “passwdlist.cfg”;
# If you want to see some output, set this to “1?
my $debug = 1;
# Set the NEW password here
my $newpass = “newpass”;
#############################
# End configuration section #
#############################
# You do not need to change anything below here
# unless you know what you are doing
use strict;
use Net::Telnet ();
# Grab the hosts file (with passwords)
if (! ( -f $passwdfile ) ){
print “ERROR: Password file $passwdfile does not exist!\n\n”;
die;
}
# Slurp the script file into memory
open (PASSWDLIST,$passwdfile);
my @hostlist = <PASSWDLIST>;
close(PASSWDLIST);
my $hostline;
my $host;
my $username;
my $passwd;
#Now, we just cycle through the list of hosts
foreach $hostline (@hostlist){
chomp $hostline;
($host,$username,$passwd) = split(“::”,$hostline);
# Login to the server
if ($debug){
print “Connecting to “. $host .”…”;
}
my $t = new Net::Telnet (Host => $host);
$t->errmode( sub { print “ERROR:” . join(‘|’, @_) . “\n”; } );
$t->login($username, $passwd);
my $errormsg = $t->errmsg;
if ( $errormsg ne “”) {
next; }
# DO THE WORK
my @changepass = $t->cmd(“/user set “. $username .” password=”. $newpass);
if ($debug) {
print “Password change successful\n”;
}
$t->close;
}
exit;
untuk menggunakan :
Saya mengunakan shell linux Ubuntu 11.04 dengan paket perl terinstall dengan benar.
contoh :
IP_mikrotik::user-admin::password-baru
Contoh
10.11.12.13::admin::passwordbaru
selamat mencoba
jadi sekarang jika lupa password mikrotik jangan khawatir lagi, karena kita bisa merubah password mikrotik dengan tool perl ini
cara makenya gmna mas yak?
Unrecognized character \xE2; marked by <– HERE after swdfile = <– HERE near co
lumn 18 at C:\Perl64\mikrotik\mikrotik.pl line 15. lo nipu gw yh.. kampret loh, gk jalan bangsat
error log itu dah kelihatan om, perl under windows nya gak suport kali om, coba di testing linux. paket devel, c-builder nya jng lupa.
kalo gak work. salah anda sendiri.
tutorialnya dong gan step by step..
share ilmu jangan setengah2..dong
sy cuma copy paste aja om, saat testing reset pass mikrotik dulu. skrng dah undur diri sy om, coba ke temen2 di FMI mungkin ada yg masih inget step nya.