Use SSH and SCP in Mac

Source: Internet
Author: User
Tags scp command

In Windows, I am used to using putty for SSH Login. for Mac, use terminal directly.

Common commands for SSH:

Use the root account to log on to the server with the specified IP address. Replace the IP address with the IP address of your server.
SSH [email protected]

If the server is not using a standard port, for example, port 4567, it is:
SSH [email protected]-P 4567

There is also a window mode in MAC:

Open a terminal and click shell-create remote connection in the menu bar.
 

A new window is displayed.

Select Secure Shell (SSH) and enter the Server IP address and User Name

 

Click Export settings on the SSH menu and you will see a test. Terminal You just named on your desktop.

 

Use SCP
The following is a simple example:

First create a local file

Echo Hello, world> a-file.txt
The command to copy a local file to the server is as follows:

SCP <local File> <remote user >@< remote machine >:< remote path>
If you want to copy a remote file to a local device:

SCP <remote user >@< remote machine >:< remote path> <local File>
You can also copy a directory:

SCP-r local_folder [email protected] _ IP: remote_folder

For example, run the following command: SCP-r/home/SPACE/music/[email protected]:/home/root/Others/

Parameter description:

[[Email protected] Test] # SCP -- Help
Usage: SCP [-1246 bcpqrv] [-C cipher] [-F ssh_config] [-I identity_file]
[-L limit] [-O ssh_option] [-P port] [-s program]
[[Email protected] host1:] file1 [...] [[email protected] host2:] file2

-1 force SCP command to use protocol SSH1
-2 force the SCP command to use the Protocol SSH2
-4 force SCP command to only use IPv4 addressing
-6 force SCP command to only use IPv6 addressing
-B uses the batch processing mode (no transmission password or phrase is asked during transmission)
-C allows compression. (Pass the-C flag to SSH to enable the compression function)
-P retains the modification time, access time, and access permission of the original file.
-Q: The transmission progress bar is not displayed.
-R Recursively copies the entire directory.
-V details display output. SCP and SSH (1) will display the debugging information of the entire process. This information is used to debug connections, verify and configure problems.
-C cipher encrypts data transmission with cipher. This option is passed directly to ssh.
-F ssh_config specifies an alternative SSH configuration file, which is passed directly to ssh.
-I identity_file: Read the key file used for transmission from the specified file. This parameter is directly transmitted to ssh.
-L limit: limits the bandwidth that a user can use, in kbit/s.
-O ssh_option if you are used to using the parameter transfer method in ssh_config (5,
-P port should be written in uppercase. Port is the port number used for data transmission.
-S Program specifies the program used for encrypted transmission. This program must be able to understand the options of SSH (1.

Use SSH and SCP in Mac

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.