mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-14 13:22:02 +00:00
commit
d4961273cb
@ -72,7 +72,8 @@ Set hostname of the router.
|
|||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
@deffn Command {password @var{password}} {}
|
@deffn Command {password @var{password}} {}
|
||||||
Set password for vty interface. If there is no password, a vty won't
|
@deffnx Command {no password} {}
|
||||||
|
Set/delete password for vty interface. If there is no password, a vty won't
|
||||||
accept connections.
|
accept connections.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
|
@ -1876,7 +1876,7 @@ DEFUN (config_no_hostname,
|
|||||||
DEFUN (config_password,
|
DEFUN (config_password,
|
||||||
password_cmd,
|
password_cmd,
|
||||||
"password [(8-8)] WORD",
|
"password [(8-8)] WORD",
|
||||||
"Assign the terminal connection password\n"
|
"Modify the terminal connection password\n"
|
||||||
"Specifies a HIDDEN password will follow\n"
|
"Specifies a HIDDEN password will follow\n"
|
||||||
"The password string\n")
|
"The password string\n")
|
||||||
{
|
{
|
||||||
@ -1916,6 +1916,31 @@ DEFUN (config_password,
|
|||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* VTY interface password delete. */
|
||||||
|
DEFUN (no_config_password,
|
||||||
|
no_password_cmd,
|
||||||
|
"no password",
|
||||||
|
NO_STR
|
||||||
|
"Modify the terminal connection password\n")
|
||||||
|
{
|
||||||
|
bool warned = false;
|
||||||
|
|
||||||
|
if (host.password) {
|
||||||
|
vty_out(vty, "Please be aware that removing the password is a security risk and you should think twice about this command\n");
|
||||||
|
warned = true;
|
||||||
|
XFREE(MTYPE_HOST, host.password);
|
||||||
|
}
|
||||||
|
host.password = NULL;
|
||||||
|
if (host.password_encrypt) {
|
||||||
|
if (!warned)
|
||||||
|
vty_out(vty, "Please be aware that removing the password is a security risk and you should think twice about this command\n");
|
||||||
|
XFREE(MTYPE_HOST, host.password_encrypt);
|
||||||
|
}
|
||||||
|
host.password_encrypt = NULL;
|
||||||
|
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
/* VTY enable password set. */
|
/* VTY enable password set. */
|
||||||
DEFUN (config_enable_password,
|
DEFUN (config_enable_password,
|
||||||
enable_password_cmd,
|
enable_password_cmd,
|
||||||
@ -1978,12 +2003,20 @@ DEFUN (no_config_enable_password,
|
|||||||
"Modify enable password parameters\n"
|
"Modify enable password parameters\n"
|
||||||
"Assign the privileged level password\n")
|
"Assign the privileged level password\n")
|
||||||
{
|
{
|
||||||
if (host.enable)
|
bool warned = false;
|
||||||
|
|
||||||
|
if (host.enable) {
|
||||||
|
vty_out(vty, "Please be aware that removing the password is a security risk and you should think twice about this command\n");
|
||||||
|
warned = true;
|
||||||
XFREE(MTYPE_HOST, host.enable);
|
XFREE(MTYPE_HOST, host.enable);
|
||||||
|
}
|
||||||
host.enable = NULL;
|
host.enable = NULL;
|
||||||
|
|
||||||
if (host.enable_encrypt)
|
if (host.enable_encrypt) {
|
||||||
|
if (!warned)
|
||||||
|
vty_out(vty, "Please be aware that removing the password is a security risk and you should think twice about this command\n");
|
||||||
XFREE(MTYPE_HOST, host.enable_encrypt);
|
XFREE(MTYPE_HOST, host.enable_encrypt);
|
||||||
|
}
|
||||||
host.enable_encrypt = NULL;
|
host.enable_encrypt = NULL;
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
@ -2647,6 +2680,7 @@ void cmd_init(int terminal)
|
|||||||
|
|
||||||
if (terminal > 0) {
|
if (terminal > 0) {
|
||||||
install_element(CONFIG_NODE, &password_cmd);
|
install_element(CONFIG_NODE, &password_cmd);
|
||||||
|
install_element(CONFIG_NODE, &no_password_cmd);
|
||||||
install_element(CONFIG_NODE, &enable_password_cmd);
|
install_element(CONFIG_NODE, &enable_password_cmd);
|
||||||
install_element(CONFIG_NODE, &no_enable_password_cmd);
|
install_element(CONFIG_NODE, &no_enable_password_cmd);
|
||||||
|
|
||||||
|
@ -1905,7 +1905,7 @@ DEFUNSH(VTYSH_ALL, no_vtysh_service_password_encrypt,
|
|||||||
|
|
||||||
DEFUNSH(VTYSH_ALL, vtysh_config_password, vtysh_password_cmd,
|
DEFUNSH(VTYSH_ALL, vtysh_config_password, vtysh_password_cmd,
|
||||||
"password (8-8) WORD",
|
"password (8-8) WORD",
|
||||||
"Assign the terminal connection password\n"
|
"Modify the terminal connection password\n"
|
||||||
"Specifies a HIDDEN password will follow\n"
|
"Specifies a HIDDEN password will follow\n"
|
||||||
"dummy string \n"
|
"dummy string \n"
|
||||||
"The HIDDEN line password string\n")
|
"The HIDDEN line password string\n")
|
||||||
@ -1915,12 +1915,19 @@ DEFUNSH(VTYSH_ALL, vtysh_config_password, vtysh_password_cmd,
|
|||||||
|
|
||||||
DEFUNSH(VTYSH_ALL, vtysh_password_text, vtysh_password_text_cmd,
|
DEFUNSH(VTYSH_ALL, vtysh_password_text, vtysh_password_text_cmd,
|
||||||
"password LINE",
|
"password LINE",
|
||||||
"Assign the terminal connection password\n"
|
"Modify the terminal connection password\n"
|
||||||
"The UNENCRYPTED (cleartext) line password\n")
|
"The UNENCRYPTED (cleartext) line password\n")
|
||||||
{
|
{
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFUNSH(VTYSH_ALL, no_vtysh_config_password, no_vtysh_password_cmd,
|
||||||
|
"no password", NO_STR
|
||||||
|
"Modify the terminal connection password\n")
|
||||||
|
{
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
DEFUNSH(VTYSH_ALL, vtysh_config_enable_password, vtysh_enable_password_cmd,
|
DEFUNSH(VTYSH_ALL, vtysh_config_enable_password, vtysh_enable_password_cmd,
|
||||||
"enable password (8-8) WORD",
|
"enable password (8-8) WORD",
|
||||||
"Modify enable password parameters\n"
|
"Modify enable password parameters\n"
|
||||||
@ -2987,6 +2994,7 @@ void vtysh_init_vty(void)
|
|||||||
install_element(CONFIG_NODE, &no_vtysh_service_password_encrypt_cmd);
|
install_element(CONFIG_NODE, &no_vtysh_service_password_encrypt_cmd);
|
||||||
|
|
||||||
install_element(CONFIG_NODE, &vtysh_password_cmd);
|
install_element(CONFIG_NODE, &vtysh_password_cmd);
|
||||||
|
install_element(CONFIG_NODE, &no_vtysh_password_cmd);
|
||||||
install_element(CONFIG_NODE, &vtysh_password_text_cmd);
|
install_element(CONFIG_NODE, &vtysh_password_text_cmd);
|
||||||
install_element(CONFIG_NODE, &vtysh_enable_password_cmd);
|
install_element(CONFIG_NODE, &vtysh_enable_password_cmd);
|
||||||
install_element(CONFIG_NODE, &vtysh_enable_password_text_cmd);
|
install_element(CONFIG_NODE, &vtysh_enable_password_text_cmd);
|
||||||
|
Loading…
Reference in New Issue
Block a user