Remote Access

Tue Jan 28 2025
Updated: Mon Jul 14 2025
Facebook share linkTwitter/X share linkLinkedIn share linkReddit share linkReddit share link

Many times in computing, it is necessary to connect one computer to another remotely—whether that computer is in the same room or on the other side of the world. These connections may involve two personal computers, or more commonly, a server. A server is a computer or program that manages access to centralized resources or services over a network. Servers often store data in files, control who can access that data, and provide critical infrastructure for countless applications. They are the backbone of modern computing—powering services accessed by millions of users worldwide, storing personal data, and facilitating everything from online purchases to social media activity. Beyond data management, servers can also be used to compile code, host games, run virtual environments, or even operate other servers—the possibilities are virtually endless.

To interact with these servers—whether to access files, manage data, or run programs—users commonly rely on remote access tools. Two of the most widely used tools for this purpose are SSH (Secure Shell) and SCP (Secure Copy), which allow secure remote login and file transfer over a network.



Secure Shell (SSH)

Secure Shell (SSH) protocol is used to connect to remote computers and servers. SSH is a network protocol that gives users, a secure way to access a computer/server over an unsecured network. SSH also refers to the suite of utilities that implement the SSH protocol. Secure Shell provides strong password authentication and public key authentication, as well as encrypted data communications between two computers connecting over an open network, such as the internet.

In addition to providing strong encryption, SSH is widely used by network administrators to manage systems and applications remotely, enabling them to log in to another computer over a network, execute commands and move files from one computer to another. SSH uses the client-server model, connecting a Secure Shell client application, which is the end where the session is displayed, with an SSH server, which is the end where the session runs. SSH implementations often include support for application protocols used for terminal emulation or file transfers.


How to use SSH

In general, to connect to a server you must have access (login credentials) and the <address> (such as an IP address or domain name) of the server. With access, the SSH command can be used:

ssh <address>

SSH allows for users to login and run terminal sessions on remote computers. When the command is run the terminal is connected to a remote host, and in turn the terminal turns into one running on the remote computer/server.

Most remote computers tend to have login credentials, thus to actually connect to a remote host and run a terminal session the user must run the secure shell command in the form:

ssh username@address

To use this command the username must be changed to a valid username for the system, and the address must be the valid address for the system the username is held on.

For example, to connect to the username alex on the server example.com enter:

ssh alex@example.com

If it is the first time connecting to the server a prompt will print asking to confirm connection to the server. The following prompt will show (with a different fingerprint depending on the server you are connecting to):

The authenticity of host 'sample.ssh.com' cannot be established. DSA key fingerprint is 01:23:45:67:89:ab:cd:ef:ff:fe:dc:ba:98:76:54:32:10. Are you sure you want to continue connecting (yes/no)?

Enter yes and the key will be saved to a system file named known_hosts. This file can be found in the hidden directory /.ssh/known_hosts from the home directory. Once a fingerprint has been saved to known_hosts future connections will not ask to confirm connecting. After accepting you want to join the server you will be prompted to enter your password.

alex@example.com's password:

Enter the password to the account. When entering the password the cursor will not move and appear frozen for security reasons. When you type your password will still be entered regardless of the missing visual cue. Once a password has been successfully entered the terminal will connect to the remote terminal. When a command prompt on the remote machine shows waiting for input the connection has been successfully established. Commands can now be entered into the terminal window and they will be run on the remote machine.



Secure Copy Protocol (SCP)

Secure Copy Protocol (SCP) allows files to be remotely uploaded from a local machine to a server, or remotely downloaded from a server to a local machine. SCP follows a strict set of protocols and algorithms to encrypt and secure data prior to ever transmitting it. This ensures that data is kept secure in transfer, so even if a malicious source obtained the data in transmission the data would be completely unreadable.


How to use SCP

In general you will need to have a piece of data (file) to send and the <sourcePath> to the file, a <username> and <password> for a remote computer, an <address> for a remote computer, and a <destPath> to save the file to on the remote computer (all explained how to use in subsequent sections). In general, SCP is used:

scp source destination

Transferring From Local -> Remote

To transfer a file from the local machine to a remote machine use the SCP command from a local terminal:

scp <sourcePath> <username>@<address>:<destPath>

Here the <sourcePath> is the path to the file to be transferred ending with the file name desired to transfer. The <username> and <address> are the username and address for the remote machine to transfer to, and <destPath> is the path to save the file on the remote machine ending with the desired name for the file. Once the command is entered the <password> will be prompted, enter it and the file will be transferred.

For example, to copy the file transfer.txt from the /home/alex/desktop/ directory on a laptop to the user work-alex on the computer workcomputer.com in the directory /home/alex/documents/ and call it resignation.txt the command would be:

scp /home/alex/desktop/transfer.txt work-alex@workcomputer.com:/home/alex/documents/resignation.txt

Transferring From Remote -> Local

To transfer a file from a remote machine to a local machine use the SCP command from a local terminal:

scp <username>@<address>:<sourcePath> <destPath>

Here the <username> and <address> are the username and address for the remote machine to transfer to, and the <sourcePath> is the path on the remote machine to the file to be transferred ending with the file name desired to transfer. The <destPath> is the path to save the file on the local machine ending with the desired name for the file. Once the command is entered the <password> will be prompted, enter it and the file will be transferred.

For example, to copy the file paystubs.txt from the /home/alex/personnel/ directory on the computer workcomputer.com using the user work-alex to a laptop in the directory /home/alex/work/ and call it paystubs.txt the command would be:

scp work-alex@workcomputer.com:/home/alex/personnel/paystubs.txt /home/alex/work/paystubs.txt


Examples


Transferring a File to a Server

Walt Disney has just finished reviewing which rides need to be closed for maintenance in July. He has saved the list as a file on his desktop:

REFURBS ON DESKTOP PHOTO

Now, Walt needs to send this information to the Disney servers at disney.com so the Imagineers know which rides to work on. He wants the file placed in the directory /company/disneyland/rides/down/july/ under the new name rides.csv using the company account imagineering.

Walt opens a Terminal window, navigates to the desktop directory on his local machine, and enters the following command:

walt@home desktop % scp july_down_rides.csv imagineering@disney.com:/company/disneyland/rides/down/july/rides.csv Password: walt@home desktop %

Password not shown as terminal would not show it

This command securely copies the file july_down_rides.csv from Walt's local machine, renames it to rides.csv, and places it in the specified directory on the remote server disney.com under the imagineering user account.


Verifying the File Made it to the Server

Now that Walt has transferred the file to the server, he wants to verify it arrived successfully—so the Imagineers can’t claim they never received it.

Walt opens a Terminal window and enters the following command to connect to the server:

walt@home desktop % ssh imagineering@disney.com imagineering@disney.com's password: imagineering@disney.com ~ %

Once he sees the terminal prompt imagineering@disney.com ~ %, Walt knows he's logged into the disney.com server under the imagineering account and is currently in the home directory (~). He navigates to the directory where he sent the file:

imagineering@disney.com ~ % cd /company/disneyland/rides/down/july/ imagineering@disney.com july %

Then, he lists the contents of the directory to confirm the file is there:

imagineering@disney.com july % ls rides.csv imagineering@disney.com july %

Seeing the file rides.csv confirms the transfer was successful and that the Imagineers can now access it and get to work.


Transferring a File From a Server

At the end of July, the Imagineers have finished their work, and the list of repaired rides has been saved on the server at the path /company/disneyland/rides/fixed/july/rides.csv. Walt now wants to download this file to his local machine and save it as july_disneyland_fixed_rides.csv on his desktop.

Walt opens a Terminal window on his local machine and runs the following command:

walt@home desktop % scp imagineering@disney.com:/company/disneyland/rides/fixed/july/rides.csv july_disneyland_fixed_rides.csv Password: walt@home desktop %

This command securely copies the file from the server at disney.com (using the imagineering account) to the current working directory on Walt’s local machine, saving it under the new name july_disneyland_fixed_rides.csv.

With the file now on his desktop, Walt has a complete record of the fixed rides—and the Imagineers have once again delivered a magical month.



Terms

  1. Server - A computer or program that manages access to centralized resources or services over a network.

  2. Secure Shell (ssh) - Protocol used to connect to remote computers and servers.

  3. Secure Copy (scp) - Protocol that allows files to be remotely uploaded from a local machine to a server, or remotely downloaded from a server to a local machine.



Questions

Servers

  1. What is a server, according to the post?

  2. Why are servers important in modern computing and the internet?

  3. What kinds of tasks or services do servers typically handle?

SSH

  1. What is SSH (Secure Shell), and why is it preferred for remote access?

  2. What is the general command to SSH to a remote computer?

  3. If a username and password is needed for SSH how does the <address> field change? Where does the password get input?

  4. Write the command to connect to the computer at the address myfirstssh.com.

  5. Write the command to connect to the computer at the IP address 8.8.8.8.

  6. Write the command to connect to the computer at the address myssh.com using the username user.

  7. Write the commands to perform the following:

    1. Connect to the computer at the address google.com using the username employee.
    2. Enter the password mypass when prompted (the prompt is: Password: ).
    3. Once connected, list the contents of the directory you are placed in upon login.

SCP

  1. What is SCP (Secure Copy Protocol)?

  2. How does SCP relate to SSH?

  3. How does SCP ensure data is securely transferred?

  4. What is the general command to transfer a file from local to remote using SCP?

  5. How does the general command to transfer a file from local to remote using SCP change if the user has credentials to use?

  6. What is the general command to transfer a file from remote to local using SCP?

  7. How does the general command to transfer a file from remote to local using SCP change if the user has credentials to use?

  8. Write the command to transfer a file named characters.csv from the current working directory on your local machine to the remote server at disney.com using the username walt. Save the file with the same name at the remote path /desktop/disneyland/actors_needed/.

  9. Write the command to transfer the file rides.csv from the directory /desktop/disneyland/rides/broken/ on the remote server disney.com using the username walt. Save it on your local machine in the directory /desktop/ using the new name broken_disneyland_rides.csv.

  10. Write the commands to perform the following tasks using the server disney.com, username walt, and password mickey for any steps that require them:

    1. Transfer a file named fixed_disneyland_rides.csv from the current working directory on your local machine to the remote server, saving it in the directory /desktop/disneyland/rides/fixed/ with the new name rides.csv.
    2. Connect to the remote server using SSH.
    3. Enter the password when prompted (the prompt is: Password: ).
    4. Navigate to the directory /desktop/disneyland/rides/broken/.
    5. List the contents of the directory.