Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSH connection using another port in OS X? [closed]

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?

like image 326
Mac Luc Avatar asked Jan 04 '15 22:01

Mac Luc


People also ask

Can I use a different port for SSH?

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.

How do I enable SSH ports on Mac?

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.

How to SSH to a server on OS X Mac?

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.

How to connect to SSH server on ports other than 22?

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!

How do I connect to a remote server via SSH?

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.

How to diagnose SSH connectivity issues on a Mac?

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.


1 Answers

Use the command line option -p for ssh:

ssh -p 5000 host
like image 194
nwk Avatar answered Oct 08 '22 23:10

nwk