# Changing The Linux 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
Port
directive to the desired SSH port number.
Port 2222
- 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_port
configuration to the desired SFTP port number.
sftp_port: 22
- Start FileMage Gateway.
sudo systemctl start filemage
Caution
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.