# 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.

  1. Stop FileMage Gateway.
sudo systemctl stop filemage
  1. Open the OpenSSH server configuration file.
sudo vi /etc/ssh/sshd_config
  1. Uncomment and set the Port directive to the desired SSH port number.
Port 2222
  1. Restart the OpenSSH server.
sudo systemctl restart sshd
  1. Verify that OpenSSH was able to start correctly.
sudo systemctl status sshd
  1. Open the FileMage Gateway configuration file.
sudo vi /etc/filemage/config.yml
  1. Set the sftp_port configuration to the desired SFTP port number.
sftp_port: 22
  1. 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.