/srv/irclogs.ubuntu.com/2018/12/05/#ubuntu-server.txt

kinghatcan someone here help me wrap my head around apache2 usr/grp/permissions?00:08
tewardkinghat: depends on what exactly you're trying to achieve?00:09
kinghatim trying to set up this php server software that is like a self hosted image host.00:10
kinghati think permissions and users and groups is making the install of it fail.00:10
tewardset ownership for the web root/dir to www-data for both user and group00:11
tewardrecursively00:11
tewardthe web server should be able to write configs then00:11
sarnold(as well as the executables :( )00:11
kinghatwell i created a group `web-content` and added the only user there is on the machine to it.00:11
kinghatalso added `www-data` to it as well.00:12
kinghati basically did this at the bottom: https://wiki.apache.org/httpd/FileSystemPermissions00:13
kinghatbut instead of `apache` i used `www-data`00:13
kinghatbut used 644 and 75500:14
tewardprobably helps to ask what happens when you *try* to install?00:14
tewardbecause such info is useful :P00:14
kinghatthe guy who made the software says 'Not a bug, because thats mean that the directory is not writable by the user'00:16
kinghatim basically starting from scratch here.00:16
tewardi'd need to see the softwarew then because something undocumented like that or not clearly written means that they don't know muhc.00:17
tewardand i didn't ask you waht **that guy** said00:17
tewardi asked you **what you witnessed**00:17
tewardI.E. the exact error messages you are seeing00:18
kinghathttps://github.com/SergiX44/XBackBone00:18
kinghatya i think it was a 500 error after it tries to install. and i think it has to do with creating a db.00:19
sarnoldhint: pastebin what happened.00:19
kinghatthis was the error: https://cdn.discordapp.com/attachments/514330611742277635/519616960741244930/unknown.png00:19
kinghatsarnold: sorry im starting from scratch so i dont have them anymore.00:19
kinghatactually i may be able to dig it up if i posted it to a bin. one sec.00:20
kinghathttp://paste.debian.net/hidden/9e9e1d42/00:21
sarnoldI hate this software already00:22
kinghatbut i was trying all different configs at the time so00:22
sarnoldwhy doesn't it give a precise error message? sigh00:22
sarnoldanyway try namei -l /var/www/html/xbackbone/app/Database/DB.php and see if that gives you any hints00:22
kinghatits pretty new00:22
kinghatwell i dont even have the software on the server anymore. like i said im starting from scratch with permissions and the user groups.00:23
kinghatshould `www-data` own everything? or what happens when i ssh or sftp in to add the server files, then it becomes owned by the user.00:25
kinghatthey are both part of the group `web-content`00:25
kinghatcant the software be owned by the group instead?00:26
sarnoldI strongly dislike www-data owning the executables but whatever works00:32
kinghatsarnold: you mean `chown -R www-data:www-data /var/www/html`00:36
kinghat?00:36
sarnoldkinghat: I also think it's a bad idea for www-data to own the data, since I don't think a compromised web server should be able to make persistent changes00:36
kinghati mean i obv have no idea how it should be i cant get it to work00:37
kinghatlet alone security implications of the different configurations.00:38
kinghatis it possible to have all files chmodded a default way for a certain dir and recursively?00:45
sarnoldnot really00:46
kinghatmaybe it just was automagically done in ftp clients that i used to use.00:46
kinghatif i transfer files over via sftp you have to change them every time00:46
kinghathuh. if i set everything to `www-data:www-data` it seems to be working.01:15
tewardkinghat: not really, FTP clients are just as stupid as SFTP is - they'd have the same permissions problems.  (SOrry I disappeared and sarnold took over I got busy)01:18
kinghatnp01:19
kinghatteward: so you think its ok to `www-data:www-data` everything?01:25
tewardno i have my reservations about it too01:26
tewardbut I typically am "OK" for that from an *installation* perspective then change the ownership to group only with write access to only what exactly is needed01:26
tewardi'm a strict it security guy so I do rigorous tests and stuff along those lines to make sure permissions are as restrictive as they can be on any webapp i use01:27
fishcookeron ubuntu 16.04.5i tried to change priority and nicelevel of a service using start-stop-daemon --start --quiet --chuid "$FAIL2BAN_USER" --nicelevel 13 --iosched 'idle' --exec $DAEMON but it won't change the prio and nice level https://paste.ubuntu.com/p/MzgznDnn6C/01:27
sarnoldis uid 0 also correct? (can it run as non-root?)01:30
kinghatteward: you mean write access to `www-data` or user?01:30
sarnoldfishcooker: is there a systemd unit file that's being used instead of a sysv-init script?01:30
cpaelzerjamespage: see mail from justin, do we cancel or postpone todays meeting then?06:23
jamespagecpaelzer: I'll cancel for today07:59
kstenerudI just got this error from launchpad when uploading a ppa: Source/binary (i.e. mixed) uploads are not allowed.08:23
kstenerudBut I built using git ubuntu build like always. Why did it upload a mixed (?) package?08:24
kstenerudand what does that even mean?08:24
cpaelzerok, thanks jamespage08:28
lordievaderGood morning10:51
ahasenackgood morning11:13
Mr_Panhrllo i need a GUI for Amavis Qauarantined File ...any  ideas?12:49
jamespagecoreycb: seeing some autopkgtest failures in disco proposed - cinder, nova - looks like a migrate + sqlite type issue13:06
coreycbjamespage: hmm ok i can take a look13:06
jamespagecoreycb: might be easier to just switch to using mysql - its a pretty simple setup (see neutron)13:07
coreycbjamespage: good point, ok13:07
Greyztaris there a way to change vi text editor edit mode key from insert to something else?my keyboard got insert on numpad/generally scuffed keyboard14:31
rbasakGreyztar: uh, the "i" key?14:35
Greyztarrbasak: hmm doesnt take me to edit mode though :/14:36
Greyztarrbasak: ahh now it works ,time to buy new keyboard haha14:37
rbasakGreyztar: you might want to give "vimtutor" a go.14:37
rbasakGreyztar: with vim installed, run "vimtutor". It'll take about half an hour and you'll know your way around vim/vi much better then.14:38
Greyztarrbasak: the problem was partially that i thought i was supposed to work also ,but when it didnt i thought it changed with some update or so,its they "i" button on keyboard itself which is scuffed amongst other keys14:39
Greyztarrbasak: thanks for the tip ill check it out (,")14:39
rbasak"a" will also work (but subtly differently - the tutorial will explain :-)14:39
Greyztarrbasak: good stuff!14:39
leftyfbCan anyone point me to some documentation for customizing an initrd booted over PXE to dd an image to the local drive ?20:05
leftyfbI find it hard to believe people haven't already done this, though I'm having trouble finding any information on it20:06
sarnoldI suspect folks start with something simple and then keep building on it until they've got a system like maas or fai :)20:08
lordcirthleftyfb, why was it you needed raw dd images specifically?  I forget20:14
leftyfblordcirth: as opposed to? This is to lay down an image into bare metal20:15
lordcirthas opposed to pxe booting a preseeded ubuntu, for example20:16
leftyfbRegardless, whatever is chosen for the disk image type, I'll still need to lay this down onto the bare metal during some running environment booted to from PXE20:16
leftyfbah20:16
leftyfbwe want images to keep every device standard20:16
lordcirthLike, when I deploy machines, I PXE boot the ubuntu server iso with a preseed, the preseed late_command installs salt-minion and connects to the master on first boot.20:17
leftyfbWe're doing d-i installs now and have issues with versions of packages changing and causing issues20:17
lordcirthThen salt 'minion' state.apply20:17
leftyfbI know all about that, I do those installs now. We want images20:17
leftyfban image will be a lot quicker to deploy 10 or more at a time regularly20:18
leftyfbThe image will be created in a CI environment20:18
leftyfbthis is coming as a surprise to me that this isn't documented somewhere already. Customizing an initrd(initramfs?) to lay a disk image down onto bare metal.20:20
leftyfbas sarnold said, this is the basis of projects like fai and maas20:21
lordcirthI'm pretty sure it's not documented under that search because they didn't do it in the initrd20:21
lordcirthbut I could be wrong20:21
sarnoldleftyfb: hmm, would it be as simple as booting with init=/bin/dd ... ?20:22
lordcirthlol20:23
lordcirthYou'd need to mount first, though20:23
leftyfbsarnold: unlikely since we'll need network to pull down the image to be dd'd20:23
leftyfbwe'll need some minimal OS running20:23
lordcirthI'm setting up test VM's now, because I'm bored20:24
leftyfbI'm digging into an initrd now, but there's got to be a more methodical way of doing this20:26
sarnoldsorry, I got a phone call while typing that20:26
sarnoldbut if you'v;e already booted into an initrd, you've *got* some amount of OS running and available20:27
lordcirthleftyfb, I'm pretty sure DRBL / Clonezilla SE do this.20:36
lordcirthleftyfb, https://wiki.gentoo.org/wiki/Custom_Initramfs/Examples20:52
sdezielwow, https://wiki.gentoo.org/wiki/Custom_Initramfs/Examples#Self-Decrypting_Server is dangerous20:58
leftyfbhm, I kinda like it actually21:02
leftyfbgives me an idea for my encrypted backups21:02
sdezielleftyfb: if the CPU's clock changes, the dynamic key to unlock the LUKS volume changes. Sounds risky to depend on something that volatile ;)21:05
lordcirthleftyfb, http://www.evanjones.ca/software/pxeimager-scratch.html21:05
TJ-leftyfb: how big is userspace FS in these systems?21:05
leftyfbTJ-: ~120G SSDs21:06
leftyfb10G images21:06
TJ-leftyfb: ahhh, so we can't embed it in the kernel image initrd then!!21:06
leftyfbsorry, make that 15, with just a raw dd image pulled with no thought into cache size21:07
leftyfbnope, not at all21:07
leftyfblordcirth: that might be exactly what I'm looking for ... going to spend the rest of this week going through it and see if it'll work the way we want21:09
TJ-leftyfb: so, semi-easy way: install dropbear-initramfs, PXE boot the image and on the PXE host have it trigger a dd if=disk.img | ssh target.robot dd of=/dev/sda" ?21:09
lordcirthIt looks pretty simple...21:09
leftyfbTJ-: got documentation on how to set something like that up?21:10
TJ-leftyfb: in my head, sure :D21:10
leftyfbTJ-: "on the PXE host have it trigger" what does that look like?21:10
TJ-leftyfb: the only hackish part would be triggering the ssh, but i'd guess watching the PXE network connection could do that21:11
TJ-leftyfb: the other option would be to reverse that and have the initrd have an ssh client that connects back to the host21:11
leftyfbTJ-: I don't follow the idea of:   the client booted the dropbear-initramfs image, the host realizes the client is booted and somehow dd's an image to the clients local storage21:12
TJ-leftyfb: in that case, the PXE/TFTP host 'knows' a client has fetched the boot image, so it can use that knowledge to trigger an ssh connection to the target, where the target is running dropbear-initramfs SSH server. The command is simply a dd through the SSH link21:17
leftyfbah21:17
TJ-leftyfb: but doing it the other way (outbound connection from initrd to host) is probably easier, and is the procedure used for things like fetching a remote LUKS encryption key. For scripts examples see e.g. http://blog.neutrino.es/2011/unlocking-a-luks-encrypted-root-partition-remotely-via-ssh/21:18
leftyfbvery hacky though21:18
TJ-Everything is 'hacky' until it works, then it's standard procedure!21:18
TJ-Even better examples with hook scripts here https://www.quora.com/Debian-GNU-Linux-How-can-I-add-an-SSH-active-client-in-the-initramfs-image-to-get-data-remotely21:22
leftyfbdamn, I wanted to try that first article you posted on my laptop but can't seem to find the rsa key pair for it21:30
leftyfbThere's no /etc/initramfs-tools/root21:30
leftyfbunless I'm supposed just make that all myself21:30
TJ-the initramfs script tools auto-create paths to files when the directories don't exist21:31
leftyfbso.... what do I run?21:32
leftyfb2) Install the required packages:21:32
leftyfbapt-get install openssh-server dropbear busybox21:32
leftyfb3) Copy the SSH key that has been generated automatically21:32
leftyfbscp root@my.server.ip.addr:/etc/initramfs-tools/root/.ssh/id_rsa ~/id_rsa.initramfs21:32
leftyfbstep 3 is invalid21:32
TJ-the quora article is much better; it even has an initramfs hook for installing ssh and so on using copy_exec21:34
leftyfbthe quora article seems like a lot more manual work compared to the first one where it assumes everything just works out of the box21:35
leftyfbit looks like I can just create the root myself and use my own keys21:37
TJ-quora is three steps; 1) create the keys in /etc/initramfs-toosl/root/ 2) create the hook script /etc/initramfs-tools/hooks/ssh-remote  3) create the initrd.img script /etc/initramfs-tools/scripts/XXXXX where XXXX is the stage of the initrd you want it to run at21:38
TJ-for copying a disk image it needs the network up but it I'd think it could be done at local-premount21:39
TJ-so the correct network modules need adding, and the network configured, first21:40
leftyfbwelp, tomorrow is another day. Thanks for the suggestions guys. I've got some reading and tinkering to do tomorrow.21:54
=== Chunkz2 is now known as ChunkzZ

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!