Ssh ������� ��� mac os

Quick Introduction to SSH for Mac Admins

What is SSH?

SSH is short for ‘Secure SHell’. It is a protocol that allows you to open a shell (terminal session) on another remote computer over the network. On macOS you will usually initiate an SSH session with the Terminal application, though there are other third party applications for macOS and iOS that support the SSH protocol as well.

On macOS SSH access is sometimes called ‘Remote Login’.

As the name implies, connections over SSH are encrypted and secure. This may not seem unusual today, but it did replace many unsecured protocols such as telnet and rlogin .

SSH is supported on many platforms. You can use SSH to connect to Macs as well as any other computer which supports SSH and has it enabled. Of course, when you SSH to a different system, the environment you get through SSH might be very different (i.e. not bash , different commands, etc.), so be sure you understand the remote system.

Enable SSH access

By default SSH access is disabled on macOS. Before you can connect to a Mac with SSH you need to enable access. In the UI you can do this in System Preferences > Sharing, by enabling the ‘Remote Login’ option. Here you can also control whether all users on the Mac can get SSH access or just some of them.

The Sharing pane will also show the current hostname of this computer:

You can also enable SSH access from the command line with

and turn it off again with

Turning SSH off with this command helpfully reminds you that if you are currently connected remotely, you will disconnect with this command and have to login locally to re-enable. To override this helpful notice, you can add the -f option:

And if you want to know which hostname a Mac thinks it is, use the hostname command:

Note: If you want to control which users have access with a script, I have an example in this post. This post was written for Munki but should be fairly easy to adapt to other systems.

Connect with SSH

To connect to a machine from another Mac (the one you are working on) is simple enough. Open Terminal and enter:

or alternatively (different syntax, same result, which one you prefer is a matter of taste)

If you do not give a username , ssh will use the short name you are currently logged in as. That is a useful shortcut if the username is the same on both systems.

When you connect to a remote machine for the first time you will get this prompt:

(Your actual fingerprint will look differently.) This prompt tells you that your ssh does not recognize this host and gives you a chance to not connect. For now, type yes to confirm. This will add the host to the list of known hosts, so the prompt will not return when you connect again. We will discuss keys and security in a later post.

Next ssh will prompt you for the password on the remote computer. Once you enter that you will get the prompt and have a secure shell to the remote computer. Any command you enter now, will be run on the remote computer.

You can connect with ssh when no user is logged in, i.e. the Mac is sitting at the login window. You can even connect with one user, while a different user is logged into the Mac with a UI session. In these cases, commands that interact with the UI, will fail, since the UI is either not running, or running as a different user. Most common examples are open and osascript (AppleScript).

If you happen to be logged in on the same Mac with the same user, then the command will work, but open will open and display the Finder window on the remote Mac, not the Mac you are working on, which can be confusing.

Ending it

To end the remote session, just use the exit command.

Читайте также:  Microsoft windows document image writer

This will return you to the shell on your Mac where you executed the ssh command.

SSH Shortcut Files

If you frequently connect to certain hosts you may want to create an ssh short cut file, which you can then just double click or invoke with spotlight.

Execute Just One Command

Instead of opening a remote shell you can use ssh to just execute just a single command on the remote host:

The ssh command will prompt for the password and the print the output of the command from the remote machine. This can be very useful. You can combine multiple commands with ;

In some case the command you want to execute remotely can prompt for information, usually a password. You can add the -t option to make ssh use an interactive shell:

This will prompt twice for the password. The first time to establish the remote connection and the second time for sudo on the remote machine.

Sending single commands with ssh can be useful for automating workflows in scripts. However, the requirement to keep entering passwords will be very detrimental to automation. It will also be annoying when you frequently connect to specific remote Macs.

Источник

PuTTY for Mac: 10 Free Alternative SSH Clients to Use

In this era dominated by the web, having your own website is very important. Whether it is to support your business or just to fuel your passion for web development, you might need to login in or transfer files remotely to servers hosting your website. For this, File Transfer Protocol (FTP) is the most common option. But if you want to ensure that the connection is protected, you should use Secure SHell protocol (SSH) which is encrypted to prevent any leakage of data. Over time, PuTTY has become the most popular terminal emulator that supports a variety of protocols. While PuTTY is very versatile, it is only available on Windows and that’s a problem for Mac users. So, if you’re a Mac user looking to utilize the power of SSH, here are some of the PuTTY alternatives SSH clients for macOS that you can check out.

PuTTY for Mac – Alternative SSH Clients in 2020

1. Terminal

The Terminal app is the default CLI that comes bundled with the Mac, and is a rather powerful tool, in case you didn’t know. You can use the Terminal to SSH into a remote server, provided, obviously, that you have the valid login credentials. Here’s a short example of how you can use the Terminal to SSH into a web-server. I’m using my website’s hosting server for illustration purposes. All you will need to do, is change the server name to your server and use your login credentials.

1. Launch Terminal.

2. Use the following command to connect to your web server using SSH:

3. It is likely that Terminal shows you the following message:

The authenticity of host ‘xxx.xxx.xxx.xxx’ can’t be established.

Are you sure you want to continue connecting (yes/no)?

Type Yes to continue.

4. You will be asked to enter the password to the server or (or control panel in case of shared hosting service). The password will not be shown, even using asterisks (*), so make sure you enter it correctly. Once you have entered the login password, hit Enter, and you will be connected via SSH. You can now run shell commands on your server.

2. iTerm2

iTerm2 is a Terminal replacement for Mac with a plethora of added features that the default Terminal app doesn’t offer. Notable among the various features that iTerm2 offers are:

  • Support for split-windows: Multiple independent terminals in the same tab.
  • Support for Annotation: Add notes and comments to shell commands that have been run.
  • Instant Playback: This feature plays back a history of everything you have done on iTerm2, in case you forgot to copy a number or some detail from older commands.
  • Better search: Searching on iTerm2 highlights all the matches for the word, like Safari and Chrome do.
  • Mouseless Copy: You don’t need to use the mouse to copy or paste text, anymore!

There are a lot of other features that are offered by iTerm2. You can read about them on their official website. The process to SSH into a web server using iTerm2 is exactly the same as the process in Terminal, except, iTerm2 will make your life easier inside the Terminal.

Download here

3. Shuttle

Shuttle is not so much an app as it is a shortcut menu for your SSH servers. Or at least that’s how it has been advertised. Since I don’t use SSH, I thought I wouldn’t really have a lot of use for it, but it turns out, Shuttle can be configured to run commands or scripts with just a couple of clicks.

Читайте также:  Как убрать с компьютера спящий режим windows

Shuttle comes with a shuttle.json file that you can edit (using a Text editor of your choice) to add SSH servers and configurations to the shortcut menu that Shuttle adds to your menu bar, and in this json file, you can actually add an entry for any command you want to run, when the corresponding menu item is clicked. This is great stuff! Not just SSH, you can basically add commands to run custom scripts simply from the menu bar, and have them open in a new Terminal window, or a new tab in the same Terminal window.

Download here

4. Termius

Termius, earlier known as Serverauditor, is more than just a simple SSH client. It is a broad set of tools which facilitates a panorama of server management applications and uses common protocols such as SSH, Mosh, and Telnet. In Termius, you can save a host so that there’s no need to enter the host address, username, or password every time before interacting with the server. Further, instead of being saved on your local machine, this data is associated with your Termius account which can be accessed on any other machine – even on an Android or iOS smartphone.

Additionally, there’s a graphical SFTP interface which lets you easily create new folders, copy new files, and manage the existing ones using simple actions. Overall, Termius is a great SSH tool for new users as well for anyone administrator who works remotely and uses many different machines to manage the server.

Terminus offers both free and paid versions. The free version comes with all basic features including SSH, Telnet and Mosh, and support for port forwarding. However, if you need other features such as secure sync, SFTP, and more, you will have to buy the paid version that costs $8.33/month.

Download here

5. OpenSSH

OpenSSH is a free and open source SSH protocol with a major focus on encryption and data protection. Data, including passwords, transmitted using OpenSSH are encrypted with multiple protocols to ensure full security of the contents on your server. Other than SSH, OpenSSH can also be used for file transfer using commands like SCP and SFTP. Besides ensuring secure tunneling of data, OpenSSH pays strong attention to passive ways of securing connections including support for multi-factor authentication and one-time passwords to prevent IP or DNS spoofing and avert fake routes. Lastly, OpenSSH also gives users the option to compress data before transmitting to ensure faster file transfers.

Setting up OpenSSH can be a bit overwhelming for new users and is only advised for those who have sufficient knowledge about SSH and other server management tools.

Download here

Setup Instructions here.

6. Royal TSX

Royal TSX is an extensive tool for managing multiple applications, virtual desktops, and server connections remotely, and all of this can be done simultaneouly. Using Royal TSX, you can load and use multiple well-known software like TeamViewer, VMware, Chicken, FreeRDP etc and protocols such as SFTP, SCP, VNC, SSH, Telnet – all of these and much more from a single interface. To manage each of these applications, IT admins must download small plug-ins but support for SSH is built it.

To start an SSH shell in Royal TSX on Mac, follow the following steps:

  1. Press Command + L and enter the server address in the following format:

ssh://xxx.xxx.xxx.xxx:yy

Here “xxx.xxx.xxx.xxx” refers to the IP address of the server and “yy” refers to the port number.

2. Press Enter and you’ll be asked to enter the username and then the password to enter the server.

3. Once you enter the password, you can use the Royal TSX in a Terminal-like interface

Royal TSX is available for free but while using the software under the shareware model, you will be limited to 10 connections and only a single document per application.

Download here

7. Hyper

Hyper is a gorgeous-looking command line interface (CLI) which offers uniformly appealing interface across all major operating systems for desktops such as Windows, Mac, and Linux. Being a CLI, it works exactly like Terminal and you can execute the same commands to call a server via SSH. As per the official website, Hyper is built around open web standards and is designed to prioritize speed and stability, but one cannot deny its attractive visuals and smooth animations are what make it a much more appealing PuTTY alternative than Terminal or iTerm2.

Читайте также:  Postgres mac os install

Download here

8. Chrome Secure Shell App

Developed by Google Secure Shell Developers, the Chrome Secure Shell is a good PuTTY for Mac alternative for anyone who works with the Google Chrome browser. It is an xterm-compatible terminal emulator and stand-alone ssh client for Chrome. The app uses Native-Client to connect directly to ssh servers without the need for external proxies. It also includes an SFTP command-line tool. I love that the developers have created extensive documentation that can teach you everything about SSH and how the app works. If you are looking for a free SSH client for Mac, you should give it a chance.

Download here

9. Kitty Terminal

Kitty Terminal is a fast GPU-based terminal emulator that offloads rendering to the GPU for lower system load and buttery smooth scrolling. If you are using one of the newest MacBook Pro and Air that comes with better-integrated graphics or the 16-inch MacBook Pro that has dedicated graphics support, you will find the performance smoother than some of the other PuTTY for Mac alternatives that we have mentioned on this list. And the performance is not the only thing that it offers. Kitty Terminal is not light on features either.

It supports all modern terminal features, including, graphics (images), Unicode, true-color, OpenType ligatures, mouse protocol, focus tracking, and more. You can control it using scripts, shell prompt, and SSH. It also brings extension support for enhancing its capabilities. The extensions are called Kitties and they let you add features like Unicode input, Hints, and Side-by-side diff tool, among others. Kitty is also known for its Startup sessions feature, which allows users to control the tabs, window layout, working directory, startup programs, etc. by creating a “session” file.

The app is also open-source and free to use forever. Overall, I would say that it’s a very capable free SSH client for Mac and can easily negate the absence of PuTTY on the platform.

Download here

10. Codinn Core Shell

Codinn Core Shell is a fully-featured terminal app with built-in support for OpenSSH. It lets you effectively login and manage hosts. The app is intuitive to use and hence great for productivity. And I know that users will enjoy its UI as it feels native to macOS. Codinn Core Shell is compatible with both Terminal.app and xterm. It supports ANSI 16 and 256 color palettes, along with 24-bit true color. It can also work with GnuPG agent, YubiKey, Authy, and Google Authenticator. The last feature that I want to mention is the theme support. It offers 8 built-in themes, and all of them look great. As you can see, It’s a capable alternative for PuTTY on Mac. The basic version of the app is free, and the premium version starts art $9.99/year.

Download here

Bonus: SecureCRT

We end our list with an SSH client that works on all platforms including macOS, Windows, and Linux. So, if you are someone who works across platforms and needs to use a familiar app everywhere, this is the one for you. It provides a solid Terminal emulation and has built-in features that will save you time while working with it. It supports SSH and offers features such as advanced scripting, remote access, data tunneling, and more. Features like keyword highlight for errors, tabbed sessions, support for Xterm 24-bit color (True Color), and more, make it a rounded SSH tool for anyone who wants to replace PuTTY. I think this is a perfect solution for anyone who works across operating systems. That being said, it only offers a free trial, and you will have to grab the paid version if you want to use it long-term. The pricing starts at $99.

Download here

Access Secure Shell Using These Putty for Mac Alternatives

While Mac already comes with Terminal built-in to run SSH commands, the options listed above expand the horizon of opportunities for you. If you’re managing a small website, learning how to use SSH can be vital, especially with the rising concerns about the safety of remotely-stored data. We would love to hear about your experience with SSH on a Mac, and the problems (if any), that you have had to face due to the lack of PuTTY support for macOS. Share your opinions in the comments section below.

Источник

Оцените статью