# Changing The OpenSSH Port
To make FileMage Gateways SFTP functionality available on port 22 on Linux, the OpenSSH service must to be re-configured to use a different port.
- Stop FileMage Gateway.
sudo systemctl stop filemage
- Open the OpenSSH server configuration file.
sudo vi /etc/ssh/sshd_config
- Uncomment and set the
Portdirective to the desired SSH port number.
- Restart the OpenSSH server.
sudo systemctl restart sshd
- Verify that OpenSSH was able to start correctly.
sudo systemctl status sshd
- Open the FileMage Gateway configuration file.
sudo vi /etc/filemage/config.yml
- Set the
sftp_portconfiguration to the desired SFTP port number.
- Start FileMage Gateway.
sudo systemctl start filemage
Make sure OpenSSH is running properly and can accept new SSH connections before disconnecting your current SSH session to avoid becoming locked out of the system.