Chapter 9. Bash
Arista switches are really Linux servers optimized and programmed to be network switches. By this point in the book, that should not be a surprise, but what may be surprising is the depth to which you, the administrator, may gain access to the system.
Note
If you really don’t like the idea of junior engineers having access to bash, you can limit their access to bash using AAA.
To access bash, type the command bash
from the enable prompt:
Arista-1#bash
Arista Networks EOS shell
[GAD@Arista-1 ~]$
At this point, I am within a bash shell on the switch. The prompt, by
default, will be [
username
@
hostname
directory
]$
. In the
previous example, I logged in to the switch with my username (GAD), as
configured in the EOS CLI. I have not created a username in Unix; the switch
took care of that for me.
At this point, I have just about all the control that I would have as a user in Linux. I am not a superuser, and my home directory is empty:
[GAD@Arista-1 ~]$ ls
[GAD@Arista-1 ~]$
I can navigate around the filesystem, just like I can on a Linux server:
[GAD@Arista-1 ~]$cd /
[GAD@Arista-1 /]$cd /usr/
[GAD@Arista-1 usr]$ls
bin etc games include kerberos lib libexec local sbin share src tmp
If you’re at all familiar with Linux, then you’ll be right at home in this bash shell:
[GAD@Arista-1 usr]$ ls -alh
total 0 drwxr-xr-x 13 root root 203 Oct 11 05:56 . drwxr-xr-x 29 root root 220 Oct 27 20:41 .. dr-xr-xr-x 2 root root 13K Oct 11 05:57 bin drwxr-xr-x 2 root root 3 Aug 25 2009 etc drwxr-xr-x ...
Get Arista Warrior now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.