I am logged into a CentOS 7 server as root.  I created a folder /somefolder.  I want someusername to be able to write to that folder via scp from a remote computer.  What command should I run so that someusername is able to type in scp /some/directory/in/remotepc someusername@centos7server:/somefolder/ and successfully transfer the file?I can guess something like chmod -R u+rw /somefolder, but that is just a guess.  And how would I specify which user?
assigning read/write privileges for a folder to a user in CentOS 7
files;permissions;users;chmod
While Anthon's answer is technically correct, I'm writing this one to explain where Octal Permissions come from, and how to calculate them. Octal Permissions is one of the most important concepts in the  *nix world.Why This Concept is ImportantSince the Birth of Unix Circa 1969 -1974 on a discarded DEC PDP-7 (see photo and history) and Linus Torvalds creation of Linux circa 1994, as a Unix like clone, file permissions have always existed at a Granular level.  Granular file permissions means that if need be, a user can grant permissions starting at the file level, and work their way up the ladder to the directories, then to the directories' parents, all the way to the root.Windows on the other hand, did not have granular permissions until the release of Windows 2000, and even now Windows Permissions are very tough to manage without the use of the GUI Window, or an add on Active Directory Server to achieve the behavior of a *nix system. How Octal Permissions WorkAll *nix file permissions work on 2 concepts:The User class - a.k.a. UGOThe Mode class - a.k.a. RWXAs Jared Heeschen states in his article:Now we look at the other way chmod can be used - with numbers. This is  the more commonly-used format, but also the least user-friendly.Since a computer works in binary, the file permissions also work in binary.  If we look at a permission string as: UGO    UGO    UGO    UGO ------------------------ 111    110    101    100when converted to base 10, we get: UGO    UGO    UGO    UGO ------------------------ 111    110    101    100  7      6      5      4Thanks, Jared for the MathThe Final StepHaving converted our binary representations to decimal numbers, we can now combine the permission for all three parts of the user class:ls -al: U  G  O-----------  -rwxrwxrwx   owner  group  file-count  date  filenameMode: 0777 U  G  O-----------   -rw-r--r--   owner  group  file-count  date  filenameMode: 0644As a shortcut, we can use this Handy Permissions Calculator and Decoder.  Once these octal numbers are understood, a user can use the chmod command and use the octal sequences to quickly change modes. As always, for more, type man chmodReferencesHow Linux file permissions workUsing chmod - octal mode 