How to Copy a folder across multiple user accounts on a Linux Ubuntu 20.0 Virtual Machine on azure.

Obomighie Sophie
2 min readApr 15, 2022

--

The aim of this article is to show you how to Copy directories from the desktop environment to a root folder on your hard drive on a Linux Ubuntu 20.04 Virtual Machine on azure when these 2 locations have multiple users (phew, what a mouthful).

Problem :

I had an Ubuntu version 20.04 Virtual Machine on azure on which I installed a desktop environment using this tutorial.

This is the structure of directories on the hard drive.
This is the structure of directories on the hard drive.

The desktop environment was located in the home directory. However, I later realized I had created one user while I was provisioning the VM and created another user while I was setting up the desktop environment. This meant this new user (sophie/admin) only had access to the desktop environment directories while the second user(Azureuser/Super admin)had complete access across board, from the root to the desktop environment. edit: This is normal in every Linux system.

Hence, azureuser(Super Admin) had write, read and execution right access. This means this user could copy/move/create files, view files and could run files in the desktop environment. While the second user(sophie) could only view files(read access) on the super admin portion of the hard drive.So the first user could copy to Sophie but Sophie could not copy to azure user.

Solution:

The solution was to fix the permission issue.
What I did was simply to run this command while signed in as the super admin.

chmod
the command I ran because the carbon embed takes time to load.

Other things I tried

  1. sudo -H
  2. nautilus admin://
  3. pkexec nautilius
    All in an attempt to run as a super admin.

Hope this was helpful.

Also posted on my blog.

References

  1. https://www.pluralsight.com/blog/it-ops/linux-file-permissions
  2. https://askubuntu.com/questions/551047/copying-files-from-one-user-to-another-in-a-single-machine
  3. https://laracasts.com/discuss/channels/general-discussion/php-artisan-errorfailed-to-open-stream-no-such-file-or-directory
  4. https://stackallflow.com/ubuntu/how-to-configure-pkexec-in-ubuntu/
  5. https://help.ubuntu.com/community/RootSudo
  6. https://help.ubuntu.com/community/FilePermissions
  7. https://www.reddit.com/r/linuxquestions/comments/n90sry/error_spawning_command_line_dbuslaunch/
  8. https://askubuntu.com/questions/86849/how-to-unzip-a-zip-file-from-the-terminal
  9. https://askubuntu.com/questions/86849/how-to-unzip-a-zip-file-from-the-terminal
  10. https://askubuntu.com/questions/133389/no-such-file-or-directory-but-the-file-exists
  11. https://www.how2shout.com/linux/open-ubuntu-file-manager-as-root-user/
  12. https://itsfoss.com/open-nautilus-as-administrator/
  13. https://askubuntu.com/questions/150028/you-are-not-the-owner-message-when-trying-to-access-folder
  14. https://www.reddit.com/r/linuxquestions/comments/n8r3a5/sudo_nautilus_not_working/gxk0uu8/
  15. https://www.reddit.com/r/linuxquestions/comments/n90sry/error_spawning_command_line_dbuslaunch/
  16. https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
  17. https://docs.microsoft.com/en-us/azure/virtual-machines/linux/use-remote-desktop

--

--