SSH Feature Overview Guide
SSH Feature Overview Guide
Introduction
This guide describes how the Secure Shell protocol (SSH) is implemented in the
AlliedWare PlusTM Operating System (OS).
It covers:
Caution: SSH was upgraded in version 5.5.1-1.1, to increase security. The upgrade means that
some older SSH clients may no longer connect to AlliedWare Plus devices running 5.5.1-1.1 or
later. To resolve this, see "In version 5.5.1-1.1 or later, older SSH clients can’t connect to
AlliedWare Plus devices" on page 5.
Protocols such as Telnet and commands like UNIX’s rlogin allow you to manage devices
remotely, but can have serious security problems, such as relying on reusable clear text
passwords that are vulnerable to wiretapping or password guessing. The Secure Shell
protocol is superior to these access methods by providing encrypted and strongly
authenticated remote login sessions.
In summary, SSH:
replaces Telnet for remote terminal sessions; SSH is strongly authenticated and encrypted.
includes remote command execution, which allows you to send commands to a device securely
and conveniently, without requiring a terminal session on the device.
allows you to connect to another host from your AlliedWare Plus device.
AlliedWare Plus supports Secure Copy (SCP) and SSH File Transfer Protocol (SFTP). Both these
protocols allow you to securely copy files between your device and remote machines. SFTP
provides additional features from SCP, such as allowing you to manipulate the remote files, and halt
or resume file transfers without closing the session.
From version 5.4.7-0.1 onwards, if the SSH service is enabled on a device and that device detects
that the host key is missing, the device generates a new host key automatically instead of
terminating SSH.
In version 5.4.9-2.1, 3DES was removed from the supported cypher set for SSH. Modern clients and
servers can continue to interoperate using AES-based cyphers transparently.
In version 5.5.1-1.1, support was removed for the ssh-rsa algorithm in OpenSSH and for SSH
protocol v1.
In version 5.5.2-0.1, the RSA key length range changed to 1024-16384 (default is 2048).
In version 5.5.2-0.1, the ECDSA key size options became 256, 384 or 521 bits (default is 384).
In version 5.5.2-1.1 the SSH server and client have been made VRF-aware
In version 5.5.2-2.1 Alongside the existing exec-mode SSH client commands, a new config-mode
SSH client command has been added.
These documents are available from the above links on our website at alliedtelesis.com.
Inbound SSH connections (server mode) and outbound SSH connections (client mode).
File loading to and from remote machines using Secure Copy, using either the SSH client or SSH
server mode.
Public keys:
ECDSA keys with key size of 256, 384 or 521 bits (default is 384).
Keys are stored in a format compatible with other SSH implementations, and mechanisms are
provided to copy keys to and from your device.
Remote non-interactive shell that allows arbitrary commands to be sent securely to your device,
possibly automatically.
File loading from remote machines using SSH File Transfer Protocol (SFTP).
A login banner on the SSH server, that displays when SSHv2 clients connect to the server.
Secure Mode enhances security by disabling any algorithms that are not supported under FIPS
(Federal Information Processing Standards). Secure Mode is available on a number of Allied Telesis
switches.
For step-by-step instructions on enabling Secure Mode, see “How to Enable Secure Mode” in the
Getting Started with AlliedWare Plus Feature Overview and Configuration Guide.
Unfortunately, some older SSH clients and older libraries still expect to use ssh-rsa and may not be able to
connect to a device running 5.5.1-1.1 or later. From version 5.5.1-1.3 onwards, AlliedWare Plus devices
automatically create an ECDSA key when the SSH service is enabled, if an ECDSA key doesn’t already exist.
This makes it possible for many of these older SSH clients to connect to AlliedWare Plus devices securely.
1. Access the CLI of the AlliedWare Plus device. If you have already upgraded
and can no longer use your SSH client, you can access the device through its
console port, or through its GUI as shown in this screenshot.
3. Either reboot the device, or turn the SSH service off and on again, using the
commands:
awplus(config)# no service ssh
awplus(config)# service ssh
Note that you only need to do this procedure on existing AlliedWare Plus devices.
From 5.5.1-1.1 onwards, AlliedWare Plus automatically creates an ECDSA key on
factory-new devices and devices that have been returned to a factory state.
When you enable the SSH server, if no host keys exist, the server automatically generates SSHv2
host key pairs using ECDSA with a curve length of 384, and RSA with a 2048-bit key (unless in
secure mode, when it only generates the ECDSA key).
To generate an RSA host key for the SSH server, use the command:
From version 5.5.2-0.1 onwards, the default RSA key length is 2048. In earlier versions, it is 1024.
To generate an ECDSA host key for the SSH server, use the command:
From version 5.5.2-0.1 onwards, the default ECDSA key size is 384. In earlier versions, it is 256.
To display the public part of a host key stored on your device, use the command:
When enabled, the SSH server allows SCP and SFTP sessions by default.
This allows you to reject SCP or SFTP file transfer requests, while still allowing Secure Shell
connections.
awplus(config)#ssh server
To modify the TCP port that the server listens to for incoming sessions, use the command:
To modify the number of unauthenticated connections the server allows, use the command:
The SSH server only allows only 10 unauthenticated SSH sessions at any point in time, by default.
To modify session and login timeouts on the SSH server, use the command:
By default, the SSH server waits 60 seconds for a client to authenticate itself. You can alter this
waiting time by using the login-timeout parameter. If the client is still not authenticated after the
timeout, then the SSH server disconnects the session.
For example:
To set the session timeout to 600 seconds, the login timeout to 30 seconds, and the maximum
number of concurrent unauthenticated sessions to 5, use the command:
awplus(config)#ssh server session-timeout 600 login-timeout 30
max-startups 5
To remove the configured timeouts and maximum startups, use the command:
awplus(config)#no ssh server session-timeout login-timeout max-startups
The SSH server and client have been made VRF-aware, and new configuration has been added to
enable this functionality.
For example:
To isolate the SSH server and make it operate within the VRF named ‘red’, use the following
command:
awplus(config)#ssh server vrf red
To return the SSH server to the global VRF use the following command:
awplus(config)#no ssh server vrf
By default SSH, and other services, operate within the global VRF.
Registered entries can contain just the username, or the username with some host details, such as
an IP address range. Additionally you can specify a range of users or hostname details by using an
asterisk to match any string of characters.
For example:
To allow any user from the IP range 192.168.1.1 to 192.168.1.255, use the command:
awplus(config)#ssh server allow-users * 192.168.1.*
To delete an entry from the list of allowed users, use the command:
awplus(config)#no ssh server allow-users <username-pattern> [<hostname-
pattern>]
The SSH server also contains a list of denied users. The server checks all incoming sessions against
this list and denies any matching session, regardless of whether the session matches an entry in the
allowed users list.
This allows you to deny specific users from a range of allowed users.
For example:
To delete a client from the database of denied users, use the command:
For example:
To associate the file key.pub with the user “langley”, use the command:
To add a key as text into the terminal for user “geoff”, first enter the command:
then paste or type the key in as text. You can add multiple keys for the same user.
To display the list of public keys associated with a user, use the command:
To delete a key associated with a user from your device, use the command:
For ciphers:
For MAC:
For all:
Note that these commands are not available in Secure Mode, because Secure Mode already
automatically limits the device to using only FIPS-approved algorithms.
The server displays the banner to clients before the login prompt.
awplus(config)#banner login
To remove the configured message for the login banner, use the command:
To display the current status of SSH sessions on your device, use the command:
awplus#show ssh
Note that this displays both SSH server and SSH client sessions that your Allied Telesis device is
running. Use this command to view the unique identification number assigned to each incoming or
outgoing SSH session. You need the ID number when terminating a specific session from your
device.
So, if you need to replace a device and copy its existing configuration file, use the following steps:
1. Make sure that the new device is in a factory-clean state. If necessary, use the erase factory-
default command to achieve this
2. Copy the firmware and configuration file from the old device to the Flash file system of the new
device
3. Set the copied files as the boot firmware and configuration files
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle
attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
55:7d:82:00:7e:6f:ac:ac:de:1c:f1:53:08:51:1c:68.
Please contact your system administrator.
Add correct host key in /Users/fergus/.ssh/known_hosts to get rid of
this message.
Offending RSA key in /Users/fergus/.ssh/known_hosts:12
RSA host key for 192.168.1.1 has changed and you have requested
strict checking.
Host key verification failed.
The SSH client uses TCP port 22, by default. You can change the TCP port for the remote SSH
server by using the port parameter.
The client terminates sessions that are not established after 30 seconds, by default. You can change
this time period by using the session-timeout parameter.
Once the client has authenticated with a server, the client does not time out the SSH session, by
default. Use the connect-timeout parameter to set a maximum time period the client waits before
deciding that a session is inactive and terminating the session.
To modify the SSH client so that it uses port 2000 for sessions, use the command:
To modify the SSH client so that unestablished sessions time out after 60 seconds, and inactive
connection time out after 100 seconds, use the command:
To remove the configured port, session timeout, and connection timeout settings, use the
command:
To make the client operate within named VRF ‘red’ for the session, use the following command:
To return the client to operating within the default VRF for the session, use the following
command:
Configuring the SSH client session with a VRF will enable scp and sftp to copy files to and from a
remote host residing within said VRF.
Alongside the existing exec-mode SSH client commands, a new config-mode SSH client command
has been added.
You can use the following SSH client config-mode command to specify a global VRF for all new
login sessions. This will become part of the devices configuration and persist across reboots.
The way this config-mode command interacts with the existing exec-mode command is as follows:
The config-mode command will configure a global SSH Client VRF, that will be used by default
for new login sessions.
Changes to the global SSH Client VRF will only affect new login sessions. The change will not be
reflected in existing sessions.
Individual login sessions may override the global SSH Client VRF through use of the existing
exec-mode ssh client vrf commands.
The exec-mode no ssh client vrf command will set the session to use the default VRF, instead of
reverting back to the global configured one.
Configure the SSH client to use VRF 'red' for the current login session. Subsequent sessions will
continue to use the default VRF. Use the command:
Configure the SSH client to use VRF 'blue' for all subsequent login sessions, excluding the current
one. Use the commands:
awplus#configure terminal
awplus(conf)#ssh client vrf blue
Configure the SSH client to use the default VRF for the current login session. Subsequent session
with continue to use VRF 'blue'. Use the command:
Configure the SSH client to use the default VRF for all subsequent login sessions, excluding the
current one. Use the commands:
The output of the show ssh client command, showing the VRF being used for this session:
To display the SSH servers in the client’s database, use the commands:
To generate an RSA set of private and public keys for an SSH user, use the command:
From version 5.5.2-0.1 onwards, the default RSA key length is 2048. In earlier versions, it is 1024.
To generate an ECDSA set of private and public keys for an SSH user, use the command:
From version 5.5.2-0.1 onwards, the default ECDSA key size is 384. In earlier versions, it is 256.
You can generate one key of each encryption type per user on your client.
To copy the public key onto the SSH server, you must display the key onscreen. To display the
public key associated with a user, use the command:
To display the public keys set for other users, you must specify their username. Only users with the
highest privilege setting can use this command to view the keys of other users.
To delete a public and private pair of keys associated with a user, use the command:
awplus#ssh <hostname>
The <hostname> parameter specifies the server and can be either an IP address or a host name.
You can also optionally specify other parameters when connecting, including the VRF instance, to
use IPv6, the user or port number to connect on, and a command to execute on the server.
For example:
to connect to the SSH server at 192.168.1.2 as user ‘john’, and execute the command show sys,
use the command:
Note that you can only specify one of user or port. To change the default port, use the command ssh
client.
to use SFTP to load a file from the SSH server 192.168.1.2, onto the Flash memory of your device,
use the command:
three SSH users are configured: Manager, John, and Asuka. “manager” can connect from only a
defined range of hosts, while “john” and “asuka” can SSH from all hosts
the SSH users use ECDSA private and public key authentication, using keys generated by the
client device.
This example shows how to create RSA encryption keys, configure the Secure Shell server, and
register users to make Secure Shell connections to your device.
awplus#configure terminal
awplus(config)#crypto key generate hostkey ecdsa 384
awplus(config)#exit
This creates a key with a size of 384. To verify the key creation, use the command:
awplus#configure terminal
awplus(config)#service ssh
For example, to set the login-timeout to 60, and the session-timeout to 3600, use the commands:
awplus#show ssh
To create the users john and asuka in the User Authentication Database, use the commands:
awplus#configure terminal
awplus(config)#username john privilege 15 password secret
awplus(config)#username asuka privilege 15 password very-secret
To register manager as an SSH client so that can only connect from the IP address 192.168.1.1, use
the command:
When using password authentication, the user must supply their User Authentication Database
password.
To use private/public key authentication, copy the public keys for each user onto the device. To copy
the files onto Flash from the key directory of an attached TFTP server, use the commands:
To associate the key file with each user, use the commands:
awplus#configure terminal
awplus(config)#crypto key pubkey-chain userkey john john.pub
awplus(config)#crypto key pubkey-chain userkey asuka asuka.pub
awplus(config)#crypto key pubkey-chain userkey manager manager.pub
awplus#configure terminal
awplus(conf)#ip vrf red 1
awplus#configure terminal
awplus(conf)#interface vlan1
awplus(conf-if)#ip vrf forwarding red
awplus(conf-if)#ip address 10.0.0.1/24
Use the following commands to configure an SSH server with VRF ‘red’:
awplus#configure terminal
awplus(conf)#ssh server vrf red
awplus(conf)#service ssh
C613-22051-00 REV J
NETWORK SMARTER
North America Headquarters | 19800 North Creek Parkway | Suite 100 | Bothell | WA 98011 | USA | T: +1 800 424 4284 | F: +1 425 481 3895
Asia-Pacific Headquarters | 11 Tai Seng Link | Singapore | 534182 | T: +65 6383 3832 | F: +65 6383 3830
EMEA & CSA Operations | Incheonweg 7 | 1437 EK Rozenburg | The Netherlands | T: +31 20 7950020 | F: +31 20 7950021
alliedtelesis.com
© 2022 Allied Telesis, Inc. All rights reserved. Information in this document is subject to change without notice. All company names, logos, and product designs that are trademarks or registered trademarks are the property of their respective owners.