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

Analysis of MySQL user management operation examples

This article describes the MySQL user management ...

Example code for converting Mysql query result set into JSON data

Mysql converts query result set into JSON data Pr...

Perform data statistics on different values ​​of the same field in SQL

Application scenario: It is necessary to count th...

Implementation of CSS dynamic height transition animation effect

This question originated from a message on Nugget...

Detailed analysis of MySQL instance crash cases

[Problem description] Our production environment ...

Html easily implements rounded rectangle

Question: How to achieve a rounded rectangle usin...

A brief discussion on MySQL event planning tasks

1. Check whether event is enabled show variables ...

Use of Linux telnet command

1. Introduction The telnet command is used to log...

How to install lua-nginx-module module in Nginx

ngx_lua_module is an nginx http module that embed...

Detailed explanation of common commands in MySQL 8.0+

Enable remote access Enable remote access rights ...

JavaScript implements countdown on front-end web page

Use native JavaScript to simply implement the cou...

Common HTML tag writing errors

We better start paying attention, because HTML Po...

Idea deployment tomcat service implementation process diagram

First configure the project artifacts Configuring...

Installation and use of Apache stress testing tools

1. Download Go to the Apache official website htt...