Skip Navigation

InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)BI
Posts
2
Comments
425
Joined
2 yr. ago

  • The non-root user probably doesn’t have permission to run the sudo command as www-data user, but root does.

    You are wrong. E. g. in Debian (and Ubuntu) the default sudoers file contains

     
        
    %sudo   ALL=(ALL:ALL) ALL
    
      

    that means that any user in the sudo group is permitted to execute any command as any other user. The same for redhat/fedora, but the group name is wheel there.

  • # is a standard shell prompt for root, and only for root. For commands executed by any other user, including sudo, use $.

    In general it is a bad practice to use sudo in documentation because in many distros it is not available by default. I would use su for your example. However system users have no passwords, so you need to become root first, and only after that change user to avoid prompting a password. So I would write

     
        
    # su -s /bin/bash www-data
    $ cp /var/www/html/html1 /var/www/html/html2
    
      

    or

     
        
    # su -s /bin/sh -c 'cp /var/www/html/html1 /var/www/html/html2' www-data
    
      

    But if you are sure that sudo is installed and configured on a user's machine, you may write

     
        
    $ sudo -u www-data cp /var/www/html/html1 /var/www/html/html2
    
      
  • In general there should not be any problem with most popular build systems (autoconf, cmake etc.) if they are used properly. However some pieces of software use build systems that are not so robust, or even self written scripts to build that causes tons of troubles. E. g. cross compiling samba is very painful. The most difficult case in when some tool is compiled and then used to generate code that will be compiled later, if developers did not implement bootstrapping properly.

    So it is impossible to give a common answer. In general cross compiling is not a problem, but in some particular cases you may need to put in a lot of effort to get it working correctly.