Before we begin
To connect to your Ubuntu Linux PC from a computer running Mac OS, you must have an SSH server up and running on Ubuntu. Not to worry, setting this up on Ubuntu is very easy compared to a lot of other Linux operating systems.
To start the process of setting up an SSH server, open up a terminal window on the Ubuntu PC. You can do this by pressing Ctrl + Alt + T or Ctrl + Shift + T on the keyboard. Once the terminal window is open and ready to go, use the apt install command to install the openssh-server package on the system.
$ sudo apt install openssh-serverLet the packages install to your Ubuntu PC. When the process is complete, use the ssh localhost command in the terminal. This command will initiate a connection to the SSH server running on Ubuntu and will allow you to test if the connection is indeed working and ready to go.
$ ssh localhostAssuming the connection is successful, you will be asked to accept the SSH key. Do so. You will then be connected to the Ubuntu SSH server locally. From here, use the exit command to finish the test.
$ exitSetting up SSH on Ubuntu is very simple, and essential to being able to connect your Mac to the operating system. However, not everyone understands SSH. If you had trouble following along with this guide.
Connect to Ubuntu from the command-line
If you’re a developer and you need access to Ubuntu from the Mac, you’ll probably be wanting access to the command-line. Thankfully, it is possible to connect to Ubuntu from the macOS terminal over SSH.
To start a connection to your Ubuntu PC from macOS, open up the Mac terminal. You can open Terminal from the Applications folder, from the Launchpad, or by searching for it in Spotlight. If you decide to access it from the Applications folder, you will find the Terminal app inside the Utilities folder nested under the Applications folder. Likewise, in Launchpad, the Terminal app is going to be inside the Utilities folder.
Once you have Terminal open, follow the step-by-step instructions below to learn how to connect to Ubuntu over SSH from Mac OS.
Step 1: Write out ssh in the terminal prompt. When the SSH connection is successful, feel free to use the command-line as if you were sitting right in front of the PC!
If you’re a developer and you need access to Ubuntu from the Mac, you’ll probably be wanting access to the command-line. Thankfully, it is possible to connect to Ubuntu from the macOS terminal over SSH.
To start a connection to your Ubuntu PC from macOS, open up the Mac terminal. You can open Terminal from the Applications folder, from the Launchpad, or by searching for it in Spotlight. If you decide to access it from the Applications folder, you will find the Terminal app inside the Utilities folder nested under the Applications folder. Likewise, in Launchpad, the Terminal app is going to be inside the Utilities folder.
Once you have Terminal open, follow the step-by-step instructions below to learn how to connect to Ubuntu over SSH from Mac OS.
Step 1: Write out ssh in the terminal prompt.
muhammadkhalil@Muhammads-MacBook-Pro ~ % ssh
Step 2: Followed by ssh, enter the username of the Ubuntu computer you’re trying to connect to over the command-line. If you can’t figure out the username, go to the Ubuntu PC, and open up a terminal. The user is the name before @ sign. For example:derrik@ubuntu-pc Example:username@IP addressStep 3: Followed by the username, write an @ sign, and the hostname of the remote Ubuntu PC. Again, if you can’t remember the hostname, it is shown in the Ubuntu terminal. For example:
derrik@ubuntu-pcStep 4: Press the return key to initiate the connection to Ubuntu. Be sure to accept the message that pops up when you start a connection.
No comments:
Post a Comment