SCP Files from the OAG Appliance
Last Updated:
Overview
Okta Access Gateway (OAG) appliances lack a default account for direct Secure Shell (SSH) or Secure Copy Protocol (SCP) access. Resolve this by creating a new account and configuring SSH keys to transfer specific log files from the appliance. Starting in May 2024, Okta Access Gateway appliances provide shell access through the management console.
NOTE: Download logs from the Admin UI to avoid requiring additional accounts. Creating additional accounts on the appliance opens an additional attack surface.
Applies To
- Okta Identity Engine (OIE)
- Okta Classic Engine
- Okta Access Gateway (OAG)
- Secure Copy Protocol (SCP)
- Version 2024.5.0 and above
Cause
By default, the Okta Access Gateway appliance lacks an account configured for direct Secure Shell (SSH) or Secure Copy Protocol (SCP) access.
Solution
How do administrators create and configure a new account for SCP access?
Connect to the appliance, create a new account, modify the SSH daemon configuration, and generate SSH keys to establish a connection.
- Connect to the appliance through the launch-shell option.
- Create the account by executing the provided command.
sudo adduser <username>
- Modify the
sshd_configfile to allow access for the newly created<username>account. Do not modify any other settings in this file.
sudo vi /etc/ssh/sshd_config
- Add
<username>to theAllowUsersdirective.
AllowUsers oag-mgmt oagha <username>
- Save the file and exit.
- Ensure there are no errors in
sshd_configusing the provided command before proceeding. Restarting with a configuration issue locks all accounts out of the appliance.
sudo sshd -t
- Restart the SSH daemon.
sudo systemctl restart sshd
- Switch to the newly created account.
sudo su - <username>
- Validate the shell is in the home directory. The bash prompt displays
<username>@<server-hostname>;/home/<username>. - Generate the SSH keys for authentication.
ssh-keygen -b 2048 -t rsa
- Use the default path
/home/<username>/.ssh/id_rsaand create a password. - Validate the files exist.
ls -la /home/<username>/.ssh/
- Create the authorized keys file and set the permissions.
touch /home/<username>/.ssh/authorized_keys
chmod 600 /home/<username>/.ssh/authorized_keys
A Linux or Mac client establishes the connection.
Copy the public key to the authorized keys file on the Okta Access Gateway appliance to connect from a Linux or Mac client.
- Copy the content of
id_rsa.pubfrom the client$HOME/.ssh/directory to theauthorized_keysfile at/home/<username>/.ssh/authorized_keys.
A Windows client establishes the connection using WinSCP.
Generate a new key pair using WinSCP and copy the public key to the Okta Access Gateway appliance to connect from a Windows client.
- Launch the WinSCP application.
- Select Advanced, choose Authentication, click Tools, select Generate New Key Pair with PuTTYgen, and click Generate.
- Save the private key to a secure location.
- Copy the public key and paste it from WinSCP into the
authorized_keysfile on the Okta Access Gateway appliance. - Ensure the private key is selected in WinSCP and the account is
<username>.
