Ssh For Mac Port



  1. Change Ssh Port Mac
  2. Ssh Mac Port Forwarding
  3. Ssh Client For Mac
  4. Ssh From Windows To Mac

Network administrators can use this information to make sure that Mac computers and other Apple devices can connect to services such as the App Store and Apple's software-update servers.

Apart from SSH, the application supports many other protocols like SCP, Telnet, Raw Socket Connection, etc. Additionally, it can also connect to a serial port. While it supports many variations on the secure remote terminal, it also facilitates user control over SSH encryption key and protocol versions. I'm using Mac OS X 10.6.4, along with a couple of other people on the same network. I have a firewall set up on my computer While I am able to connect to most people remotely, using the command (in terminal) ssh username@IP address (I get the IP address by pinging the computer name) There are a couple of people where I come across the message of: 'Port 22: Connection refused' (or something.

Ports used by Apple products

This is a quick-reference guide showing common examples, not a comprehensive list of ports. This guide is updated periodically with information available at the time of publication.

Change Ssh Port Mac

Some software might use different ports and services, so it can be helpful to use port-watching software when deciding how to set up firewalls or similar access-control schemes.

Some services might use more than one of these ports. For example, a VPN service can use up to four different ports. When you find a product in this list, search (Command-F) in your browser for that name, then repeat your search (Command-G) to locate all occurrences of that product.

Some firewalls allow selective configuration of UDP or TCP ports with the same number, so it's important to know the type of port you're configuring. For example, NFS can use TCP 2049, UDP 2049, or both. If your firewall doesn't allow you to specify the type of port, configuring one type of port probably configures the other.

PortTCP or
UDP
Service or
protocol name
1
RFC2Service name3Used by
7TCP/UDPecho792echo
20TCPFile Transport Protocol (FTP)959ftp-data
21TCPFTP control959ftp
22TCPSecure Shell (SSH), SSH File Transfer Protocol (SFTP), and Secure copy (scp)4253sshXcode Server (hosted and remote Git+SSH; remote SVN+SSH)
23TCPTelnet854telnet
25TCPSimple Mail Transfer Protocol (SMTP)5321smtp

Mail (sending email); iCloud Mail (sending email)

53TCP/UDPDomain Name System (DNS)1034domain
67UDPBootstrap Protocol Server (BootP, bootps)951bootpsNetBoot via DHCP
68UDPBootstrap Protocol Client (bootpc)951bootpcNetBoot via DHCP
69UDPTrivial File Transfer Protocol (TFTP)1350tftp
79TCPFinger1288finger
80TCPHypertext Transfer Protocol (HTTP)2616httpWorld Wide Web, FaceTime, iMessage, iCloud, QuickTime Installer, Maps, iTunes U, Apple Music, iTunes Store, Podcasts, Internet Radio, Software Update (OS X Lion or earlier), Mac App Store, RAID Admin, Backup, Calendar, WebDAV, Final Cut Server, AirPlay, macOS Internet Recovery, Profile Manager, Xcode Server (Xcode app, hosted and remote Git HTTP, remote SVN HTTP)
88TCPKerberos4120kerberosKerberos, including Screen Sharing authentication
106TCPPassword Server
(unregistered use)
3com-tsmuxmacOS Server Password Server
110TCPPost Office Protocol (POP3),
Authenticated Post Office Protocol (APOP)
1939pop3Mail (receiving email)
111TCP/UDPRemote Procedure Call (RPC)1057, 1831sunrpcPortmap (sunrpc)
113TCPIdentification Protocol1413ident
119TCPNetwork News Transfer Protocol (NNTP)3977nntpApps that read newsgroups.
123UDPNetwork Time Protocol (NTP)1305ntpDate & Time preferences, network time server synchronization, Apple TV network time server sync
137UDPWindows Internet Naming Service (WINS)netbios-ns
138UDPNETBIOS Datagram Servicenetbios-dgmWindows Datagram Service, Windows Network Neighborhood
139TCPServer Message Block (SMB)netbios-ssnMicrosoft Windows file and print services, such as Windows Sharing in macOS
143TCPInternet Message Access Protocol (IMAP)3501imapMail (receiving email)
161UDPSimple Network Management Protocol (SNMP)1157snmp
192UDPOSU Network Monitoring Systemosu-nmsAirPort Base Station PPP status or discovery (certain configurations), AirPort Admin Utility, AirPort Express Assistant
311TCPSecure server administrationasip-webadminServer app, Server Admin, Workgroup Manager, Server Monitor, Xsan Admin
312TCPXsan administrationvslmpXsan Admin (OS X Mountain Lion v10.8 and later)
389TCPLightweight Directory Access Protocol (LDAP)4511ldapApps that look up addresses, such as Mail and Address Book
427TCP/UDPService Location Protocol (SLP)2608svrlocNetwork Browser
443TCPSecure Sockets Layer (SSL or HTTPS)2818httpsTLS websites, iTunes Store, Software Update (OS X Mountain Lion and later), Spotlight Suggestions, Mac App Store, Maps, FaceTime, Game Center, iCloud authentication and DAV Services (Contacts, Calendars, Bookmarks), iCloud backup and apps (Calendars, Contacts, Find My iPhone, Find My Friends, Mail, iMessage, Documents & Photo Stream), iCloud Key Value Store (KVS), iPhoto Journals, AirPlay, macOS Internet Recovery, Profile Manager, Dictation, Siri, Xcode Server (hosted and remote Git HTTPS, remote SVN HTTPS, Apple Developer registration), Push notifications (if necessary)
445TCPMicrosoft SMB Domain Servermicrosoft-ds
464TCP/UDPkpasswd3244kpasswd
465TCPMessage Submission for Mail (Authenticated SMTP)smtp (legacy)Mail (sending mail)
500UDPISAKMP/IKE2408isakmpmacOS Server VPN service
500UDPWi-Fi Calling5996IKEv2Wi-Fi Calling
514TCPshellshell
514UDPSyslogsyslog
515TCPLine Printer (LPR), Line Printer Daemon (LPD)printerPrinting to a network printer, Printer Sharing in macOS
532TCPnetnewsnetnews
548TCPApple Filing Protocol (AFP) over TCPafpovertcpAppleShare, Personal File Sharing, Apple File Service
554TCP/UDPReal Time Streaming Protocol (RTSP)2326rtspAirPlay, QuickTime Streaming Server (QTSS), streaming media players
587TCPMessage Submission for Mail (Authenticated SMTP)4409submissionMail (sending mail), iCloud Mail (SMTP authentication)
600–1023TCP/UDPMac OS X RPC-based servicesipcserverNetInfo
623UDPLights-Out-Monitoringasf-rmcpLights Out Monitoring (LOM) feature of Intel-based Xserve computers, Server Monitor
625TCPOpen Directory Proxy (ODProxy) (unregistered use)dec_dlmOpen Directory, Server app, Workgroup Manager; Directory Services in OS X Lion or earlier
This port is registered to DEC DLM
626TCPAppleShare Imap Admin (ASIA)asiaIMAP administration (Mac OS X Server v10.2.8 or earlier)
626UDPserialnumberd (unregistered use)asiaServer serial number registration (Xsan, Mac OS X Server v10.3 – v10.6)
631TCPInternet Printing Protocol (IPP)2910ippmacOS Printer Sharing, printing to many common printers
636TCPSecure LDAPldaps
660TCPServer administrationmac-srvr-adminServer administration tools for Mac OS X Server v10.4 or earlier, including AppleShare IP
687TCPServer administrationasipregistryServer administration tools for Mac OS X Server v10.6 or earlier, including AppleShare IP
749TCP/UDPKerberos 5 admin/changepwkerberos-adm
985TCPNetInfo Static Port
993TCPMail IMAP SSLimapsiCloud Mail (SSL IMAP)
995TCP/UDPMail POP SSLpop3s
1085TCP/UDPWebObjectswebobjects
1099, 8043TCPRemote RMI and IIOP Access to JBOSSrmiregistry
1220TCPQT Server Adminqt-serveradminAdministration of QuickTime Streaming Server
1640TCPCertificate Enrollment Servercert-responderProfile Manager in macOS Server 5.2 and earlier
1649TCPIP Failoverkermit
1701UDPL2TPl2fmacOS Server VPN service
1723TCPPPTPpptpmacOS Server VPN service
1900UDPSSDPssdpBonjour
2049TCP/UDPNetwork File System (NFS) (version 3 and 4)3530nfsd
2195TCPApple Push Notification Service (APNS)Push notifications
2196TCPApple Push Notification Service (APNS)Feedback service
2197TCPApple Push Notification Service (APNS)Push notifications
2336TCPMobile account syncappleugcontrolHome directory synchronization
3004TCPiSynccsoftragent
3031TCP/UDPRemote AppleEventseppcProgram Linking, Remote Apple Events
3283TCP/UDPNet Assistantnet-assistantApple Remote Desktop 2.0 or later (Reporting feature), Classroom app (command channel)
3284TCP/UDPNet Assistantnet-assistantClassroom app (document sharing)
3306TCPMySQLmysql
3478–3497UDPnat-stun-port - ipether232portFaceTime, Game Center
3632TCPDistributed compilerdistcc
3659TCP/UDPSimple Authentication and Security Layer (SASL)apple-saslmacOS Server Password Server
3689TCPDigital Audio Access Protocol (DAAP)daapiTunes Music Sharing, AirPlay
3690TCP/UDPSubversionsvnXcode Server (anonymous remote SVN)
4111TCPXGridxgrid
4398UDPGame Center
4488TCPApple Wide Area Connectivity Serviceawacs-ice
4500UDPIPsec NAT Traversal4306ipsec-msftmacOS Server VPN service
4500UDPWi-Fi Calling5996IKEv2Wi-Fi Calling
5003TCPFileMaker - name binding and transportfmpro-internal
5009TCP(unregistered use)winfsAirPort Utility, AirPort Express Assistant
5100TCPsocaliamacOS camera and scanner sharing
5222TCPXMPP (Jabber)3920jabber-clientJabber messages
5223TCPApple Push Notification Service (APNS)iCloud DAV Services (Contacts, Calendars, Bookmarks), Push Notifications, FaceTime, iMessage, Game Center, Photo Stream
5228TCPSpotlight Suggestions, Siri
5297TCPMessages (local traffic)
5350UDPNAT Port Mapping Protocol AnnouncementsBonjour
5351UDPNAT Port Mapping Protocolnat-pmpBonjour
5353UDPMulticast DNS (MDNS)3927mdnsBonjour, AirPlay, Home Sharing, Printer Discovery
5432TCPPostgreSQLpostgresqlCan be enabled manually in OS X Lion Server (previously enabled by default for ARD 2.0 Database)
5897–5898UDP(unregistered use)xrdiags
5900TCPVirtual Network Computing (VNC)
(unregistered use)
vnc-serverApple Remote Desktop 2.0 or later (Observe/Control feature)
Screen Sharing (Mac OS X 10.5 or later)
5988TCPWBEM HTTPwbem-httpApple Remote Desktop 2.x
See also dmtf.org/standards/wbem.
6970–9999UDPQuickTime Streaming Server
7070TCPRTSP (unregistered use), Automatic Router Configuration Protocol (ARCP)arcpQuickTime Streaming Server (RTSP)
7070UDPRTSP alternatearcpQuickTime Streaming Server
8000–8999TCPirdmiWeb service, iTunes Radio streams
8005TCPTomcat remote shutdown
8008TCPiCal servicehttp-altMac OS X Server v10.5 or later
8080TCPAlternate port for Apache web servicehttp-altAlso JBOSS HTTP in Mac OS X Server 10.4 or earlier
8085–8087TCPWiki serviceMac OS X Server v10.5 or later
8088TCPSoftware Update serviceradan-httpMac OS X Server v10.4 or later
8089TCPWeb email rulesMac OS X Server v10.6 or later
8096TCPWeb Password ResetMac OS X Server v10.6.3 or later
8170TCPHTTPS (web service/site)

Podcast Capture/podcast CLI

8171TCPHTTP (web service/site)

Podcast Capture/podcast CLI

8175TCPPcast Tunnelpcastagentd (such as for control operations and camera)
8443TCPiCal service (SSL)pcsync-httpsMac OS X Server v10.5 or later (JBOSS HTTPS in Mac OS X Server 10.4 or earlier)
8800TCPAddress Book servicesunwebadminMac OS X Server v10.6 or later
8843TCPAddress Book service (SSL)Mac OS X Server v10.6 or later
8821, 8826
TCPStoredFinal Cut Server
8891TCPldsdFinal Cut Server (data transfers)
9006TCPTomcat standaloneMac OS X Server v10.6 or earlier
9100TCPPrintingPrinting to certain network printers
9418TCP/UDPgit pack transfergitXcode Server (remote git)
10548TCPApple Document Sharing ServiceserverdocsmacOS Server iOS file sharing
11211memcached (unregistered use)Calendar Server
16080TCPWeb service with performance cache
16384–16403UDPReal-Time Transport Protocol (RTP), Real-Time Control Protocol (RTCP)connected, —Messages (Audio RTP, RTCP; Video RTP, RTCP)
16384–16387UDPReal-Time Transport Protocol (RTP), Real-Time Control Protocol (RTCP)connected, —FaceTime, Game Center
16393–16402UDPReal-Time Transport Protocol (RTP), Real-Time Control Protocol (RTCP)FaceTime, Game Center
16403–16472UDPReal-Time Transport Protocol (RTP), Real-Time Control Protocol (RTCP)Game Center
24000–24999TCPmed-ltpWeb service with performance cache
42000–42999TCPiTunes Radio streams
49152–65535TCPXsanXsan Filesystem Access
49152– 65535UDP
50003FileMaker server service
50006FileMaker helper service

1. The service registered with the Internet Assigned Numbers Authority, except where noted as “unregistered use.”

2. The number of a Request for Comment (RFC) document that defines the service or protocol. RFC documents are maintained by RFC Editor.

3. In the output of Terminal commands, the port number might be replaced by this Service Name, which is the label listed in /etc/services.

FaceTime is not available in all countries or regions.

Learn more

The application firewall in macOS is not a port-based firewall. It controls access by app, instead of by port.

-->

Azure DevOps Services | Azure DevOps Server 2020 | Azure DevOps Server 2019 | TFS 2018 - TFS 2015

Connect to your Git repos through SSH on macOS, Linux, or Windows to securely connect using HTTPS authentication. On Windows, we recommended the use of Git Credential Managers or Personal Access Tokens.

Important

SSH URLs have changed, but old SSH URLs will continue to work. If you have already set up SSH, you should update your remote URLs to the new format:

  • Verify which remotes are using SSH by running git remote -v in your Git client.
  • Visit your repository on the web and select the Clone button in the upper right.
  • Select SSH and copy the new SSH URL.
  • In your Git client, run: git remote set-url <remote name, e.g. origin> <new SSH URL>. Alternatively, in Visual Studio, go to Repository Settings, and edit your remotes.

Note

As of Visual Studio 2017, SSH can be used to connect to Git repos.

How SSH key authentication works

SSH public key authentication works with an asymmetric pair of generated encryption keys. The public key is shared with Azure DevOps and used to verify the initial ssh connection. The private key is kept safe and secure on your system.

Set up SSH key authentication

The following steps cover configuration of SSH key authentication on the following platforms:

  • Linux
  • macOS running at least Leopard (10.5)
  • Windows systems running Git for Windows

Configure SSH using the command line. bash is the common shell on Linux and macOS and the Git for Windows installation adds a shortcut to Git Bash in the Start menu.Other shell environments will work, but are not covered in this article.

Step 1: Create your SSH keys

Note

If you have already created SSH keys on your system, skip this step and go to configuring SSH keys.

The commands here will let you create new default SSH keys, overwriting existing default keys. Before continuing, check your~/.ssh folder (for example, /home/jamal/.ssh or C:Usersjamal.ssh) and look for the following files:

  • id_rsa
  • id_rsa.pub

If these files exist, then you have already created SSH keys. You can overwrite the keys with the following commands, or skip this step and go to configuring SSH keys to reuse these keys.

Mac

Create your SSH keys with the ssh-keygen command from the bash prompt. This command will create a 2048-bit RSA key for use with SSH. You can give a passphrasefor your private key when prompted—this passphrase provides another layer of security for your private key.If you give a passphrase, be sure to configure the SSH agent to cache your passphrase so you don't have to enter it every time you connect.

This command produces the two keys needed for SSH authentication: your private key ( id_rsa ) and the public key ( id_rsa.pub ). It is important to never share the contents of your private key. If the private key iscompromised, attackers can use it to trick servers into thinking the connection is coming from you.

Step 2: Add the public key to Azure DevOps Services/TFS

Mac

Associate the public key generated in the previous step with your user ID.

  1. Open your security settings by browsing to the web portal and selecting your avatar in the upper right of theuser interface. Select SSH public keys in the menu that appears.

  2. Select + New Key.

  3. Copy the contents of the public key (for example, id_rsa.pub) that you generated into the Public Key Data field.

    Important

    Avoid adding whitespace or new lines into the Key Data field, as they can cause Azure DevOps Services to use an invalid public key. When pasting in the key, a newline often is added at the end. Be sure to remove this newline if it occurs.

  4. Give the key a useful description (this description will be displayed on the SSH public keys page for your profile) so that you can remember it later. Select Save to store the public key. Once saved, you cannot change the key. You can delete the key or create a new entry for another key. There are no restrictions on how many keys you can add to your user profile.

  5. Test the connection by running the following command: ssh -T git@ssh.dev.azure.com.If everything is working correctly, you'll receive a response which says: remote: Shell access is not supported.If not, see the section on Questions and troubleshooting.

Step 2: Add the public key to Azure DevOps Services/TFS

Associate the public key generated in the previous step with your user ID.

  1. Open your security settings by browsing to the web portal and selecting your avatar in the upper right of theuser interface. Select Security in the menu that appears.

  2. Select + New Key.

  3. Copy the contents of the public key (for example, id_rsa.pub) that you generated into the Public Key Data field.

    Important

    Avoid adding whitespace or new lines into the Key Data field, as they can cause Azure DevOps Services to use an invalid public key. When pasting in the key, a newline often is added at the end. Be sure to remove this newline if it occurs.

  4. Give the key a useful description (this description will be displayed on the SSH public keys page for your profile) so that you can remember it later. Select Save to store the public key. Once saved, you cannot change the key. You can delete the key or create a new entry for another key. There are no restrictions on how many keys you can add to your user profile.

  5. Test the connection by running the following command: ssh -T git@ssh.dev.azure.com.If everything is working correctly, you'll receive a response which says: remote: Shell access is not supported.If not, see the section on Questions and troubleshooting.

Step 3: Clone the Git repository with SSH

Note

To connect with SSH from an existing cloned repo, see updating your remotes to SSH.

  1. Copy the SSH clone URL from the web portal. In this example, the SSL clone URL is for a repo in an organization named fabrikam-fiber, as indicated by the first part of the URL after dev.azure.com.

    Note

    Project URLs have changed with the release of Azure DevOps Services and now have the format dev.azure.com/{your organization}/{your project}, but you can still use the existing visualstudio.com format. For more information, see VSTS is now Azure DevOps Services.

  2. Run git clone from the command prompt.

SSH may display the server's SSH fingerprint and ask you to verify it.You should verify that the displayed fingerprint matches one of the fingerprints in the SSH public keys page.

SSH displays this fingerprint when it connects to an unknown host to protect you from man-in-the-middle attacks.Once you accept the host's fingerprint, SSH will not prompt you again unless the fingerprint changes.

When you are asked if you want to continue connecting, type yes. Git will clone the repo and set up the origin remote to connect with SSH for future Git commands.

Tip

Avoid trouble: Windows users will need to run a command to have Git reuse their SSH key passphrase.

Questions and troubleshooting

Ssh Mac Port Forwarding

Q: After running git clone, I get the following error. What should I do?

A: Manually record the SSH key by running:ssh-keyscan -t rsa domain.com >> ~/.ssh/known_hosts

Q: How can I have Git remember the passphrase for my key on Windows?

A: Run the following command included in Git for Windows to start up the ssh-agent process in PowerShell or the Windows Command Prompt. ssh-agent will cacheyour passphrase so you don't have to provide it every time you connect to your repo.

If you're using the Bash shell (including Git Bash), start ssh-agent with:

For

Q: I use PuTTY as my SSH client and generated my keys with PuTTYgen. Can I use these keys with Azure DevOps Services?

A: Yes. Load the private key with PuTTYgen, go to Conversions menu and select Export OpenSSH key.Save the private key file and then follow the steps to set up non-default keys.Copy your public key directly from the PuTTYgen window and paste into the Key Data field in your security settings.

Q: How can I verify that the public key I uploaded is the same key as I have locally?

A: You can verify the fingerprint of the public key uploaded with the one displayed in your profile through the following ssh-keygen command run against your public key usingthe bash command line. You will need to change the path and the public key filename if you are not using the defaults.

You can then compare the MD5 signature to the one in your profile. This check is useful if you have connection problems or have concerns about incorrectlypasting in the public key into the Key Data field when adding the key to Azure DevOps Services.

Q: How can I start using SSH in a repository where I am currently using HTTPS?

A: You'll need to update the origin remote in Git to change over from a HTTPS to SSH URL. Once you have the SSH clone URL, run the following command:

You can now run any Git command that connects to origin.

Q: I'm using Git LFS with Azure DevOps Services and I get errors when pulling files tracked by Git LFS.

A: Azure DevOps Services currently doesn't support LFS over SSH. Use HTTPS to connect to repos with Git LFS tracked files.

Q: How can I use a non default key location, i.e. not ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub?

A: To use keys created with ssh-keygen in a different place than the default, you do two things:

  1. The keys must be in a folder that only you can read or edit. If the folder has wider permissions, SSH will not use the keys.
  2. You must let SSH know the location of the keys. You make SSH aware of keys through the ssh-add command, providing the full path to the private key.

On Windows, before running ssh-add, you will need to run the following command from included in Git for Windows:

This command runs in both PowerShell and the Command Prompt. If you are using Git Bash, the command you need to use is:

You can find ssh-add as part of the Git for Windows distribution and also run it in any shell environment on Windows.

Ssh Client For Mac

On macOS and Linux you also must have ssh-agent running before running ssh-add, but the command environment on these platforms usuallytakes care of starting ssh-agent for you.

Q: I have multiple SSH keys. How do I use different SSH keys for different SSH servers or repos?

A: Generally, if you configure multiple keys for an SSH client and connect to an SSH server, the client can try the keys one at a time until the server accepts one.

However, this doesn't work with Azure DevOps for technical reasons related to the SSH protocol and how our Git SSH URLs are structured. Azure DevOps will blindly accept the first key that the client provides during authentication. If that key is invalid for the requested repo, the request will fail with the following error:

For Azure DevOps, you'll need to configure SSH to explicitly use a specific key file. One way to do this to edit your ~/.ssh/config file (for example, /home/jamal/.ssh or C:Usersjamal.ssh) as follows:

Q: How do I fix errors that mention 'no matching key exchange method found'?

A: Git for Windows 2.25.1 shipped with a new version of OpenSSH which removed some key exchange protocols by default.Specifically, diffie-hellman-group14-sha1 has been identified as problematic for some Azure DevOps Server and TFS customers.You can work around the problem by adding the following to your SSH configuration (~/.ssh/config):

Replace <your-azure-devops-host> with the hostname of your Azure DevOps or TFS server, like tfs.mycompany.com.

Q: What notifications may I receive about my SSH keys?

A: Whenever you register a new SSH Key with Azure DevOps Services, you will receive an email notification informing you that a new SSH key has been added to your account.

Q: What do I do if I believe that someone other than me is adding SSH keys on my account?

Ssh From Windows To Mac

A: If you receive a notification of an SSH key being registered and you did not manually upload it to the service, your credentials may have been compromised.

The next step would be to investigate whether or not your password has been compromised. Changing your password is always a good first step to defend against this attack vector. If you’re an Azure Active Directory user, talk with your administrator to check if your account was used from an unknown source/location.