Port 2222 - Coded in sshd_config
Port 2222 - Coded in sshd_config
In the sshd_config file I have port 2222 coded. Is there a way to code the port so that it is the default port so I do not have to specifiy it when issuing the sftp command? For example: I enter sftp -oPort=2222 userid@dnsname. I would like to configure it so I can enter sftp userid@dnsname.
Re: Port 2222 - Coded in sshd_config
I have had my questioned asked by one of my co-workers. We will be adding the port into the client.rc file. For example, adding: COZSFTP_CLIENT_OPTS="-o port=2222"
Re: Port 2222 - Coded in sshd_config
Yes, but adding COZSFTP_CLIENT_OPTS="-oPort=2222" to cozsftp_client.rc would set that for all invocations (connecting to all servers).
This may not be what you want.
Since this is actually an option to the IBM Ported Tools ssh command (the ssh client), you can also add it to /etc/ssh/ssh_config or $HOME/.ssh/ssh_config.
In these files, you might want to use the conditional Host keyword so as to only set the port to 2222 for some hosts, or maybe *.some.doman.
For example:
# /etc/ssh/ssh_config - the system-wide defaults for the ssh client)
...
# Connect to any server in the following domain OR subnet with port 2222 instead of 22
Host *.myco.com 192.168.?.?
Port 2222
Host *
...
See the IBM Ported Tools OpenSSH User's guide under ssh_config for details.
This may not be what you want.
Since this is actually an option to the IBM Ported Tools ssh command (the ssh client), you can also add it to /etc/ssh/ssh_config or $HOME/.ssh/ssh_config.
In these files, you might want to use the conditional Host keyword so as to only set the port to 2222 for some hosts, or maybe *.some.doman.
For example:
# /etc/ssh/ssh_config - the system-wide defaults for the ssh client)
...
# Connect to any server in the following domain OR subnet with port 2222 instead of 22
Host *.myco.com 192.168.?.?
Port 2222
Host *
...
See the IBM Ported Tools OpenSSH User's guide under ssh_config for details.