Magento or OpenCart to build an independent self-built website, it is essential to use SSH to connect to the server, execute some commands, and make some configuration adjustments. If you are using a server vm instance created by Google Cloud, you can naturally connect to the SSH management website directly in the browser interface. But every time I have to open the Google Cloud website, find the instance, open ssh, and wait for the ssh interface to load, it seems a bit cumbersome and time-consuming.
Then, the easier way is to directly open the "terminal" on the Mac computer, and use the ssh command to directly connect to the Google cloud service provider remotely. In order to allow the Google cloud server instance to communicate directly with the local computer, we need to prepare two keys: a private key and a mobile number list public key. 1. First obtain the key from the local mac computer through a simple command; ssh-keygen -t rsa -f ~/.ssh/gc_rsa -C bitnami Among them, "gc_rsa" is the key name; "bitnami" is the user name of the server; (here the server is installed by bitnam company The optimized version of , so by default, the user name is bitnami, please modify it to your own server user name according to your actual situation.) Executing the command will ask you to enter and confirm the password, just confirm it here. How to connect to a server instance on.
Google Cloud via SSH on Apple MacOS and upload files using SFTP13 Then enter the following command to enter the .ssh directory .ssh And use the ls command to list the contents of the files in the current directory [cc]ls How to connect to a server instance on Google Cloud via SSH on Apple MacOS and upload files using SFTP 14 You will find two files, gc_rsa and gc_rsa.pub, here we get our 2 keys, a private key gc_rsa and a public key gc_rsa.pub. Next, we need to copy the content of instance. Open the public key gc_rsa.pub with the following command [cc]vim gc_rsa.pub You will find a bunch of gibberish, copy it down.