I need upload some scripts to hostgator hosting /home/[username] directory, then sftp is a good choice here.
1 |
sftp username@host |
But I got following error:
Connecting to port 22 failed
After reading hostgator's documentation, I realized that hostgator hosting's default ssh port is 2222 but not 22. Then I tried:
1 |
sftp username@host -oPort=2222 |
But same error appeared again.. After searching on google for a while, I got that -oPort=2222 should be placed before username@host
1 |
sftp -oPort=2222 username@host |