User Tools

Site Tools


infrastructure:unix

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
infrastructure:unix [2018-08-31 10:05] – created mrksinfrastructure:unix [2020-06-11 12:18] (current) – mrks
Line 1: Line 1:
 ====== Unix ====== ====== Unix ======
 +
 +
 +===== Shell =====
 +
 +[[https://stackoverflow.com/questions/8473121/execute-command-without-keeping-it-in-history|Execute command  without keeping it in hostory]]:
 +
 +  * Sometimes shell commands must be kept form history, e.g. when setting secrets to environment variables for configuring applications according to the [[https://12factor.net/config|Twelve-Factor-App]].
 +  * Configure the shell to not record history when starting with a space: ''$ export HISTCONTROL=ignorespace''
 +  * Execute the command with a secret with a leading space: ''$ ⌴export⌴MY_PASSWORD=the-secret''
 +  * Verified in Bash. The command will not be recorded in ''~/.bash_history''.
  
  
Line 8: Line 18:
  
   * Set owner: ''$ chown myfolder myuser''   * Set owner: ''$ chown myfolder myuser''
 +  * Set owner and group: ''$ chown myowner:mygroup myfolder''
   * Change password: ''$ passwd''   * Change password: ''$ passwd''
   * List user's groups: ''$ groups somebody''   * List user's groups: ''$ groups somebody''
Line 14: Line 25:
 ==== Groups ==== ==== Groups ====
  
- +  * Set group: ''$ chgrp mygroup myfolder'' 
-  * Set group: ''$ chgrp myfolder mygroup''+  * Set owner and group: ''$ chown myowner:mygroup myfolder''
   * List group members: ''$ getent group some-group''   * List group members: ''$ getent group some-group''
  
Line 22: Line 33:
  
   * Flag s: created folders and files inherit the group of the upper folder. ''$ chmod g+s file.txt''   * Flag s: created folders and files inherit the group of the upper folder. ''$ chmod g+s file.txt''
-  * Setting specific group permissions:+  * List permissions: 
 +    * ''$ getfacl file.txt'' 
 +    * ''$ ls -lV'' 
 +  * Set specific group permissions:
     * ''$ setfacl -m u:somebody:rwx file.txt''     * ''$ setfacl -m u:somebody:rwx file.txt''
     * ''$ setfacl -m g:some-group:rw file.txt''     * ''$ setfacl -m g:some-group:rw file.txt''
-  * Setting default group permissions:+  * Set default group permissions:
     * ''$ setfacl -m default:g::rwx file.txt''     * ''$ setfacl -m default:g::rwx file.txt''
     * ''$ setfacl -m default:g:some-group:r file.txt''     * ''$ setfacl -m default:g:some-group:r file.txt''
-  * Removing a group: ''$ setfacl -x g:some-group file.txt''+  * Remove a group: ''$ setfacl -x g:some-group file.txt''
   * http://manpages.ubuntu.com/manpages/xenial/man1/setfacl.1.html   * http://manpages.ubuntu.com/manpages/xenial/man1/setfacl.1.html
infrastructure/unix.1535702747.txt.gz · Last modified: (external edit)