Creating Alias

 Creating Alias to escape username spaces in SCP

In this tutorial, I'll will be showing you guys how to create an alias for those who have space in their username. As we may know, using quote for username which has spaces won't work for SCP. However, using quote for username for SSH will work. The following are the example: 

1) Using the SSH command




2) Using the SCP command



The solution to this problem is by creating an alias for the username. We can add special configuration to the user's ssh config, usually in ~/.ssh/config


We will run and change some config as follows:

1) First, type in the following command in terminal: nano ~/.ssh/config then press Enter



2) You should see the following page in your terminal. It should be a blank page. 



3) Now, to create an alias. Type the following command: 

Host 'Put any name you want'

User "The username of the pc you want to connect to"

Hostname 'Ip address of the pc you want to connect to'

  *Note: Replace the apostrophe ( ' ) and the content inside it with your own data*  


For this tutorial, we will use the following data. 


  *Note: Make sure to quote username with space*  

Once that done, press CTRL + X  to exit, press Y  to confirm the changes and press Enter.  


3) Now we can proceed with the scp command. 



Thank You!