In Cisco NX-OS, Bash
is accessible from user accounts that are associated with the Cisco NX-OS
dev-ops role or the Cisco NX-OS network-admin role.
The following example
shows the authority of the dev-ops role and the network-admin role:
switch# show role name dev-ops
Role: dev-ops
Description: Predefined system role for devops access. This role
cannot be modified.
Vlan policy: permit (default)
Interface policy: permit (default)
Vrf policy: permit (default)
-------------------------------------------------------------------
Rule Perm Type Scope Entity
-------------------------------------------------------------------
4 permit command conf t ; username *
3 permit command bcm module *
2 permit command run bash *
1 permit command python *
switch# show role name network-admin
Role: network-admin
Description: Predefined network admin role has access to all commands
on the switch
-------------------------------------------------------------------
Rule Perm Type Scope Entity
-------------------------------------------------------------------
1 permit read-write
switch#
Bash is enabled by
running the
feature
bash-shell command.
The
run bash
command loads Bash and begins at the home directory for the user.
The following examples
show how to enable the Bash shell feature and how to run Bash.
switch# configure terminal
switch(config)# feature bash-shell
switch# run bash
Linux# whoami
admin
Linux# pwd
/bootflash/home/admin
Linux#
Note |
You can also execute
Bash commands with the
run bash <command>
command.
The following is an
example of the
run bash <command>
command.
run bash whoami
|