Explanation of Mac connecting to remote servers through SSH in different terminals

Explanation of Mac connecting to remote servers through SSH in different terminals

Mac uses Shell (Terminal) SSH to connect to the remote server

Prerequisite: You need to have the IP address, port number, account and password of the server you need to connect to

1. First open the terminal, then enter sudo su - Enter to enter the root directory

2. Then enter: ssh -p port number server username@ip (for example ssh -p 22 [email protected]) and press Enter. You will be asked to enter yes or no to confirm whether to connect. Enter yes and press Enter.

3. Then enter the user password on the server and press Enter

4. Now you have entered the directory of your account on the server, which means the connection is successful. Finally, enter sudo su - to enter the root directory of the server and perform operations.

Mac remotely connects to the Linux server through the built-in Terminal SSH

1. When using Windows, Xmanager and the Xshell tool in it are very convenient, but they do not support OS. I learned on the Internet that Mac can remotely connect to Linux server through SSH protocol directly in the terminal.

2. The command format for connection is very simple:

ssh space username@target machine IP address

It is worth noting that there may be two situations here

The password set by the backend buddy contained a field: p0st. I later asked someone for help and found out that the circle was a 0, not a capital O. So when the password is wrong, you may also see permission denied . Be sure to "check" the password and username.

Then the second situation is also encountered more frequently on the Internet. I have already set it up before, so after the password is correct, I can connect successfully directly:

permission denied or authentication denied , which means insufficient permissions

Here you need to modify the value of a configuration file to pass

vi /etc/ssh/ssh_config

Click i to enter the edit state and set PasswordAuthentication to yes

Then remove the # sign in front of PasswordAuthentication to make it effective.

Then shut down the ssh service using the command

sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist

Then restart and remove un

sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist

Enter a command to view the restart status

sudo launchctl list | grep ssh

If there is a line with -0 or something, it is successful

Then reconnect and it should be able to connect

Summarize

The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links

You may also be interested in:
  • Detailed explanation of how to pass password to ssh/scp command in bash script
  • Detailed explanation of how to mount remote file systems via SSH on Linux
  • CentOS method to modify the default ssh port number example
  • Detailed installation and use of SSH in Ubuntu environment
  • Instructions for deploying projects to remote machines using the Publish Over SSH plugin in Jenkins
  • CentOS 6.5 configuration ssh key-free login to execute pssh command explanation
  • Ubuntu basic settings: installation and use of openssh-server
  • How to install MySQL via SSH on a CentOS VPS
  • How to configure ssh/sftp and set permissions under Linux operating system
  • Implementation of ssh non-secret communication in linux

<<:  Solution to mysql login warning problem

>>:  WeChat applet uses the video player video component

Recommend

Docker container accesses the host's MySQL operation

background: There is a flask project that provide...

How to use the Linux more command in Linux common commands

more is one of our most commonly used tools. The ...

Share 13 excellent web wireframe design and production tools

When you start working on a project, it’s importa...

How to modify the default storage location of Docker images (solution)

Due to the initial partitioning of the system, th...

Detailed explanation of MySQL alter ignore syntax

When I was at work today, the business side asked...

What is a MySQL tablespace?

The topic I want to share with you today is: &quo...

Understanding and solutions of 1px line in mobile development

Reasons why the 1px line becomes thicker When wor...

Detailed tutorial on installing CentOS, JDK and Hadoop on VirtualBox

Table of contents 1. Prerequisites 1.1 Supported ...

Solve the problem of docker images disappearing

1. Mirror images disappear in 50 and 93 [root@h50...

Which scenarios in JavaScript cannot use arrow functions

Table of contents 1. Define object methods 2. Def...

HTML small tag usage tips

Phrase elements such as <em></em> can ...

Detailed Example of Row-Level Locking in MySQL

Preface Locks are synchronization mechanisms used...

Install MySQL (including utf8) using Docker on Windows/Mac

Table of contents 1. Docker installation on Mac 2...