spot_imgspot_img

Merubah Password Mikrotik dengan Perl

Advertisements

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

 

 

Artikulli paraprak
Artikulli tjetër
boled
boledhttp://abyfine.com
Agun Nurul Widiyanto A.K.A Boled , adalah seorang yang biasa saja tidak kaya, tidak ganteng tidak suka orang ALLAY, LEBE dll. Masih seneng belajar dari mana saja. Senang dan Hobi menjadi Praktisi Implementasi JIBAS Server Online, Mikrotik Networking, Linux Server, dan SMS getway Temukan Saya di Facebook , Twitter, Google+

Get in Touch

  1. 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.

    • 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.

TINGGALKAN KOMENTAR

Silakan masukkan komentar anda!
Silakan masukkan nama Anda di sini

 

Related Articles

Get in Touch

14,000FansSuka
1,323PengikutMengikuti
3,121PengikutMengikuti
4,000PengikutMengikuti
0PelangganBerlangganan

Post Pilihan

WhatsApp chat