Mailing List Archive

backing up ubiquiti edgerouter
Hi all,

Does anybody know the syntax for cloginrc and router.db for edgerouters?

I've tried various permutations and either:
- it won't log in because there isn't an enable password
- if I set autoenable to 1, it will log in but fail to back up:

$ clogin -t edgerouter MYDEVICE
MYDEVICE
spawn ssh -x -l ubnt MYDEVICE
Welcome to EdgeOS

By logging in, accessing, or using the Ubiquiti product, you
acknowledge that you have read and understood the Ubiquiti
License Agreement (available in the Web UI at, by default,
http://192.168.1.1) and agree to be bound by its terms.

Linux MYDEVICE 3.10.107-UBNT #1 SMP Mon Mar 5 18:18:48 UTC 2018 mips64
Welcome to EdgeOS
Last login: Tue Apr 28 05:41:57 2015 from 2a00:my:ip:went::here

Error: TIMEOUT reached
Re: backing up ubiquiti edgerouter [ In reply to ]
Fri, Jul 20, 2018 at 10:19:38AM +0100, Craig Hopkins:
> Hi all,
>
> Does anybody know the syntax for cloginrc and router.db for edgerouters?
>
> I've tried various permutations and either:
> - it won't log in because there isn't an enable password
> - if I set autoenable to 1, it will log in but fail to back up:
>
> $ clogin -t edgerouter MYDEVICE

ulogin

> MYDEVICE
> spawn ssh -x -l ubnt MYDEVICE
> Welcome to EdgeOS
>
> By logging in, accessing, or using the Ubiquiti product, you
> acknowledge that you have read and understood the Ubiquiti
> License Agreement (available in the Web UI at, by default,
> http://192.168.1.1) and agree to be bound by its terms.
>
> Linux MYDEVICE 3.10.107-UBNT #1 SMP Mon Mar 5 18:18:48 UTC 2018 mips64
> Welcome to EdgeOS
> Last login: Tue Apr 28 05:41:57 2015 from 2a00:my:ip:went::here
>
> Error: TIMEOUT reached

> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss@shrubbery.net
> http://www.shrubbery.net/mailman/listinfo/rancid-discuss

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss@shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Re: backing up ubiquiti edgerouter [ In reply to ]
On Fri, 20 Jul 2018 at 15:16, heasley <heas@shrubbery.net> wrote:

> Fri, Jul 20, 2018 at 10:19:38AM +0100, Craig Hopkins:
> > Hi all,
> >
> > Does anybody know the syntax for cloginrc and router.db for edgerouters?
> >
> > I've tried various permutations and either:
> > - it won't log in because there isn't an enable password
> > - if I set autoenable to 1, it will log in but fail to back up:
> >
> > $ clogin -t edgerouter MYDEVICE
>
> ulogin
>

That's only part of it, though. I still need the right .cloginrc commands.
If I use ulogin, then:

$ ulogin MYDEVICE
MYDEVICE
spawn ssh -x -l ubnt MYDEVICE
Welcome to EdgeOS

By logging in, accessing, or using the Ubiquiti product, you
acknowledge that you have read and understood the Ubiquiti
License Agreement (available in the Web UI at, by default,
http://192.168.1.1) and agree to be bound by its terms.

Linux MYDEVICE 3.10.107-UBNT #1 SMP Fri Jun 22 14:27:52 UTC 2018 mips64
Welcome to EdgeOS
Last login: Fri Jul 20 09:09:49 2018 from MY.IP.GOES.HERE
ubnt
ubnt@MYDEVICE:~$ ubnt
-vbash: ubnt: command not found
ubnt@MYDEVICE:~$

Where is that extra "ubnt" coming from?



>
> > MYDEVICE
> > spawn ssh -x -l ubnt MYDEVICE
> > Welcome to EdgeOS
> >
> > By logging in, accessing, or using the Ubiquiti product, you
> > acknowledge that you have read and understood the Ubiquiti
> > License Agreement (available in the Web UI at, by default,
> > http://192.168.1.1) and agree to be bound by its terms.
> >
> > Linux MYDEVICE 3.10.107-UBNT #1 SMP Mon Mar 5 18:18:48 UTC 2018 mips64
> > Welcome to EdgeOS
> > Last login: Tue Apr 28 05:41:57 2015 from 2a00:my:ip:went::here
> >
> > Error: TIMEOUT reached
>
> > _______________________________________________
> > Rancid-discuss mailing list
> > Rancid-discuss@shrubbery.net
> > http://www.shrubbery.net/mailman/listinfo/rancid-discuss
>
>
Re: backing up ubiquiti edgerouter [ In reply to ]
On 20/07/18 15:22, Craig Hopkins wrote:
>
>
> That's only part of it, though. I still need the right .cloginrc
> commands. If I use ulogin, then:
>
> $ ulogin MYDEVICE
> MYDEVICE
> spawn ssh -x -l ubnt MYDEVICE
> Welcome to EdgeOS
>
> By logging in, accessing, or using the Ubiquiti product, you
> acknowledge that you have read and understood the Ubiquiti
> License Agreement (available in the Web UI at, by default,
> http://192.168.1.1) and agree to be bound by its terms.
>
> Linux MYDEVICE 3.10.107-UBNT #1 SMP Fri Jun 22 14:27:52 UTC 2018 mips64
> Welcome to EdgeOS
> Last login: Fri Jul 20 09:09:49 2018 from MY.IP.GOES.HERE
> ubnt
> ubnt@MYDEVICE:~$ ubnt
> -vbash: ubnt: command not found
> ubnt@MYDEVICE:~$
>
> Where is that extra "ubnt" coming from?

I expect the "Last login:" message is confusing ulogin and that's why it
sends the username again.

alexd
Re: backing up ubiquiti edgerouter [ In reply to ]
Fri, Jul 20, 2018 at 04:53:09PM +0100, Alex DEKKER:
> On 20/07/18 15:22, Craig Hopkins wrote:
> >
> >
> > That's only part of it, though. I still need the right .cloginrc
> > commands. If I use ulogin, then:
> >
> > $ ulogin MYDEVICE
> > MYDEVICE
> > spawn ssh -x -l ubnt MYDEVICE
> > Welcome to EdgeOS
> >
> > By logging in, accessing, or using the Ubiquiti product, you
> > acknowledge that you have read and understood the Ubiquiti
> > License Agreement (available in the Web UI at, by default,
> > http://192.168.1.1) and agree to be bound by its terms.
> >
> > Linux MYDEVICE 3.10.107-UBNT #1 SMP Fri Jun 22 14:27:52 UTC 2018 mips64
> > Welcome to EdgeOS
> > Last login: Fri Jul 20 09:09:49 2018 from MY.IP.GOES.HERE
> > ubnt
> > ubnt@MYDEVICE:~$ ubnt
> > -vbash: ubnt: command not found
> > ubnt@MYDEVICE:~$
> >
> > Where is that extra "ubnt" coming from?
>
> I expect the "Last login:" message is confusing ulogin and that's why it
> sends the username again.

probably; thats new. this ought to address that.

Index: bin/ulogin.in
===================================================================
--- bin/ulogin.in (revision 3831)
+++ bin/ulogin.in (working copy)
@@ -170,6 +170,12 @@
-nocase -re "^warning: remote host denied authentication agent forwarding." {
exp_continue;
}
+ -nocase -re "last login:" {
+ exp_continue
+ }
+ -nocase -re "failed login:" {
+ exp_continue
+ }
eof { send_user "\nError: Couldn't login\n"; wait; return 1 }
-nocase "unknown host\r" {
catch {close}; catch {wait};

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss@shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Re: backing up ubiquiti edgerouter [ In reply to ]
I'm dependent on the debian releases, but I've added the changes you've
made to our running version of ulogin, and it works fine now. Thanks for
your help.

On Fri, 20 Jul 2018 at 17:09, heasley <heas@shrubbery.net> wrote:

> Fri, Jul 20, 2018 at 04:53:09PM +0100, Alex DEKKER:
> > On 20/07/18 15:22, Craig Hopkins wrote:
> > >
> > >
> > > That's only part of it, though. I still need the right .cloginrc
> > > commands. If I use ulogin, then:
> > >
> > > $ ulogin MYDEVICE
> > > MYDEVICE
> > > spawn ssh -x -l ubnt MYDEVICE
> > > Welcome to EdgeOS
> > >
> > > By logging in, accessing, or using the Ubiquiti product, you
> > > acknowledge that you have read and understood the Ubiquiti
> > > License Agreement (available in the Web UI at, by default,
> > > http://192.168.1.1) and agree to be bound by its terms.
> > >
> > > Linux MYDEVICE 3.10.107-UBNT #1 SMP Fri Jun 22 14:27:52 UTC 2018 mips64
> > > Welcome to EdgeOS
> > > Last login: Fri Jul 20 09:09:49 2018 from MY.IP.GOES.HERE
> > > ubnt
> > > ubnt@MYDEVICE:~$ ubnt
> > > -vbash: ubnt: command not found
> > > ubnt@MYDEVICE:~$
> > >
> > > Where is that extra "ubnt" coming from?
> >
> > I expect the "Last login:" message is confusing ulogin and that's why it
> > sends the username again.
>
> probably; thats new. this ought to address that.
>
> Index: bin/ulogin.in
> ===================================================================
> --- bin/ulogin.in (revision 3831)
> +++ bin/ulogin.in (working copy)
> @@ -170,6 +170,12 @@
> -nocase -re "^warning: remote host denied authentication agent
> forwarding." {
> exp_continue;
> }
> + -nocase -re "last login:" {
> + exp_continue
> + }
> + -nocase -re "failed login:" {
> + exp_continue
> + }
> eof { send_user "\nError: Couldn't login\n"; wait; return 1 }
> -nocase "unknown host\r" {
> catch {close}; catch {wait};
>
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss@shrubbery.net
> http://www.shrubbery.net/mailman/listinfo/rancid-discuss
>