Remote Desktop / SSH / Basic Command line
Amanda Triplett 10/2019
Description: Accessing your computer via SSH through your command line with a general example of how to create a TAR file remotely and move it to your home computer. It also outlines how to remotely manage your desktop from mac to mac computer.
Method 1a: From Apple to Apple: SSH
- Open a command line and type ssh “your_username”@”your_static_IP”
- If you’ve never logged in you will have to type “yes” in order to connect
- Enter the password for the computer you’re trying to access
- You are now accessing that other computer via the command line (anything you do while connected through this command line window will happen on the other computer)
Method 1b: Creating a TAR file on a remote computer and pulling it to your current computer
- After you followed the steps in 1a, you can create a file and pull it, or just pull an already created file to your local computer
- Navigate to the folder where the file of interest is stored using a combination of ls (which tells you what is in the current folder and cd “file_dir” to navigate to the new folder.
- Once you are in the folder where your file of interest is, type pwd to get the current file path
- If your file is small and does not need to be TARd skip the next step
- Creating a TAR
- Type the following:
- tar -czvf “file_name”.tar.gz “your file path from pwd” .
- C = create an archive
- Z = compress a folder with gzip (remove the z and .gz to do a regular tar)
- V = display progress in terminal (AKA verbose mode, this is also optional)
- F = (allows you to specify your filename)
- The “ .” will stop the entire absolute file pathway from being there when you extract
- You should have a new tar file if you ls
- Transferring
- Open a new command window, this one will be accessing the computer you’re on now
- Navigate (using cd and ls) to the folder where you want to put your file (you don’t have to do this but I think it makes things easier)
- Once you’re there, type the following “scp “your_username”@”your_static_ip”:”your_file_path/filename.tar.gz” .
- The “ .” means put this file where I am right now (that’s why we navigated to the right folder, otherwise you type the filepath of where you want the file to go instead)
- Change tar.gz to your appropriate file extension
- Unzipping the file (if needed)
- gunzip -c foo.tar.gz | tar xopf
- for tar.gz
- You don’t need to specify a file path if you are already in the folder where you want things extracted
- tar -xvf filename.tar -C path you want to copy it to
- gunzip -c foo.tar.gz | tar xopf
Method 2: From Apple to Apple: Using VPN and Remote Management
- Make sure your desktop has a static IP (all desktops have them at this time)
- Change your settings to allow remote management
- System Preferences -> sharing
- Check Screen sharing and remote management
- When you click remote management, select the capabilities you want when logging in remotely
- Get the VPN software
- Go to Vpn.arizona.edu
- NetID: your user name
- NetID Password:
- NetID Method: Push (If you’re using Duo Mobile)
- After logging in click AnyConnect in the left toolbar
- Download the VPN software.
- Run the Cisco Anyconnect (you probably have to log in again)
- When the VPN runs the box may be blank. It should be: vpn.arizona.edu
- Go to Finder
- Select the Go menu from the top navigation bar (where the apple is) and go all the way to the bottom of the menu where it says connect to server
- Type in vnc://”your_static_IP” and click connect
- You should now be able to control your desktop