I want to connect through the terminal in OS X to my Linux server with SSH - But how do i connect if i changed the SSH port to, lets say, 5000 instead os 22?
To change the SSH port: Log on to the server as an administrator. Search for the entry Port 22. Replace port 22 with a port between 1024 and 65536.
To find the SSH command to use to log in to your Mac from another computer, choose Apple menu > System Preferences, click Sharing , then select Remote Login. The SSH command is shown below the “Remote Login: On” indicator. Allowing remote login to your Mac can make it less secure. See Set up your Mac to be secure.
Mac OS features a built-in SSH client called Terminal which allows you to quickly and easily connect to a server. In this article, we'll outline how to SSH to a server using the Terminal program on OS X Mac. SSH utilizes TCP port 22 by default, although this can be changed to a non-standard port.
Steps to connect to SSH server on ports other than 22: Check the port that the SSH server runs on. Test if the port that the SSH server listens to is reachable from the client host. $ nc -zv remotehost 2022 Connection to remotehost 2022 port [tcp/*] succeeded!
The basic syntax of connecting to SSH is as follows: Replace user and IP-Address with the username and IP on the remote server. Hit return to execute the command. This will connect to the server via SSH with the username user and the default SSH port 22.
Verbose mode is helpful in diagnosing SSH connectivity issues as it outputs all of the steps of the connection process: Type exit to end the connection. The default terminal in Mac is a white and grey interface like this: But there are a variety of different colour configurations, including dark mode.
Use the command line option -p
for ssh
:
ssh -p 5000 host
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With