[01:48] Hello! So, I want to make a script that, when called runs the "screen" command, which then upon creation runs the "optirun" command (from bumblebee, for controlling nvidia GPUs) which then runs the java command to run a program under optirun within the screen. [01:50] The issue I am having now is that when this happens, the java program crashes because it attempts to modify files that it cannot because it needs root permissions. So, I need to A) find a way to have the script give ONLY either that optirun command OR that java command sudo privaleges (that initial script is being run with root privileges due to it being owned by the root folder, and also being accessed by systemd) [01:51] or B) make it so that jar can access all the files it needs without root without enabling ANYONE to modify or run those files other than root and this jar [01:59] Hey all, just curious how to do a completely unattended install of Ubuntu 18.04 Server. It looks like the installer has changed away from d-i. [09:36] hi [09:37] is true that: networkd contains its own in-built DHCP client implementation ? [09:38] can I disable? or set static IP ? [09:39] sacarde: yes, and of course. [09:39] it only means you don't need dhclient or similar, if you want dhcp. [09:39] I have a proble, I set in "interfaces" only a static ip [09:40] but when system start it get a dhcp ip too [09:40] which Ubuntu? [09:40] ubuntuserver1804 [09:41] I remove dhcpcd dhclient pkgs [09:41] 18.04 no longer uses /etc/network/interfaces, which is part of "ifupdown" package. It uses netplan, which is configuration abstraction tool that works with backend: networkd on servers, and NetworkManager on desktops. [09:41] But you don't have to use neplan either, you can configure a .network unit directly, for networkd. [09:41] !netplan [09:41] Netplan is a network configuration abstraction renderer which uses YAML descriptions of a network to work with either a NetworkManager or Systemd-networkd "renderer". More information at https://netplan.io/ [09:42] can you show me an example? static ip without dhcp [09:42] sacarde: click that link [09:42] ah ok [09:47] is nfs the only way to mount a drivepartition from the server on my client machine? or can this be done in ext4? [09:49] SlowJimmy: ext4 is on-disk filesystem, nfs is network "filesystem" that works with any underlying on-disk one. One alternative to nfs is samba. [09:51] blackflow can i convert ext4 to nfs without harming the preexisting data? [09:52] SlowJimmy: no, nfs does not exist as an on-disk format. there's no mkfs.nfs. nfs is a system that allows you to export one directory, over the network, mountable as if it was local, onto another machine [09:53] it's actually more than one directory, so called "exports", but the gist is it works like that. [09:54] so it is similar to samba but just for real computers not just windows? [09:55] i see, i dont have a man page but i will just read up on nfs somewhere they are bound to talk about how i can share the ext4 partition [09:55] smb/cifs and nfs are protocols similar in functionality, yes. [09:55] i mean if i understand right, then i can just follow some procedure or list of steps and use nfs to make the partition available [09:55] pretty much, yes. [09:55] man you cant imagine how invaluable your help has been [09:56] you don't have to convert anything, you just export some directories, over the network, to anotehr machine. [09:56] that will do wonders for my backups [09:56] !nfs | SlowJimmy see this [09:56] SlowJimmy see this: nfs is the network file system. See https://help.ubuntu.com/community/SettingUpNFSHowTo for information on installing and configuring NFS. [09:56] SlowJimmy: note, however, there's no TLS or encryption involved, so if you're doing it over the public network, you'll need to take additional steps. [09:56] didnt have a man page for nfs on sys [09:57] (nfsv4 can do some encryption with kerberos, but what I mean is, it's not there by default) [09:57] how do i protect against somebody somehow sitting on my internal network? [09:58] or what if one of the clients is infected? [09:58] then all my data is fair game? [09:58] can you tell with the network conenctions and so forth if somebody is accessing your network who shouldnt be? [09:59] if you don't trust your network then treat it like public internet [10:00] SlowJimmy: that's why you set up authentication and encrypt connections. NFSv4 is capable of that. [10:00] or use something like VPN tunneling [10:00] i have a question regarding authentication, if you use keypair authentication for ssh and a password is the password still cleartext? [10:00] oh ok i will try to set everything up that way [10:01] better safe than sorry [10:01] also if you got a keypair set up... how do you prevent your privatekey falling into the wrong hands? [10:02] i mean if it just sits on a client wont it be a risk because once that client is compromised then basically the server and withit the whole network? [10:02] you're asking overly broad questions. with ssh keys you have private and public keys. you can share the public one freely, and you protect the private one with a passphrase. [10:03] you keep that private as protected as possible, and teh passphrase is there in case of it being stolen or compromised, teh attacker would still need to know the passphrase to use that key. [10:03] blackflow but wont that be useless if the computer you use to conect with to the server has been compromised? i mean wouldnt they be able to just copy the private key and key log the pasphrase? [10:03] so public keys are form of 2FA in itself. something you know (the passphrase to even use the key) and something you have (the key itself). [10:04] "log the passphrase"? only if they somehow see you type it in. [10:05] so if they got my system compromised with a trojan wotn they be able to use keylogging functions of that malware to basically record the keystrokes? [10:05] in theory, yes. [10:05] i mean if one of the clients i use to ssh in is compromised isnt then the whole system gone? [10:05] i mean server and all other clients? [10:05] but they'll also need to get that key in order to use it. [10:05] but wouldnt that be easily done with a keylogger? [10:06] no. like I said, you give public keys to the machines you log into. public keys work only in conjunction with your private key, so if the public key is stolen, nothing bad happens. [10:07] pubkey auth is a form of asymmetric encryption. it takes one key to encrypt and another key to decypt. one key cannot be used for both. in this particular case, the private key you keep to yourself, protected, and the public key is given out to machines you ssh into. [10:07] no i know, i just am not clear how the private keys sittig on the clients isnt a huge security risk? [10:08] the private keys shouldn't be "sitting on the clients", if "clients" are machines you SSH into. [10:09] no i mean the clients is what i use to ssha into the server [10:09] the server has the public key [10:09] and the client has the private key [10:09] you can even do this. put your private key on usb. with ssh-agent running on your local machine, you instert the usb stick once, unlock the key (ssh agent remembers it), and you can remove the USB. that machine can now use the ssh-agent to access remote machines with that private-public key pair. [10:10] basically my lapto ruig ubuntu has a pricvage key and my server has the public key but if somebody takes over my desktop with the private key isnt then the whole system lost? [10:10] but yes, if tha "client" is compromised, if the ssh private key is stolen, if the passphrase for the private key is easy to guess or tortured out of you, ur dun goof'd. [10:11] wait but if the desktop is just in any way compromised then the private key is bound to be just simply copied by the attacker and they can easily isntall a keylogger to capture my passphrase, no? [10:12] in fact, a few years ago there was an attack on servers noted on webhostingtalk forums, servers with tight security and pubkey auth were being compromised. the conclusion was (and I don't know if it was every 100% confirmed) that there was a trojan that stole those private keys, the admins were windows users, and itw as in conjunction with how they used putty. [10:12] so in this keypair authentication it all hinges on the assumption that your desktop runing ubuntu is not compromised or has a trojan or whaterver they use [10:12] SlowJimmy: yes, but..... balance of probabilities. [10:13] in fact, this is ONE reason why I run custom AppArmor profiles that forbid any app with network access, from touching ~/.ssh/ [10:13] and the usb thing does not help since once compromised they do not need to have access to the usb costatly only once woudl be enough... [10:13] and they would not have to be connected to do that either [10:14] blackflow› that is excellent [10:14] and that is why security is hard. [10:14] you prevent any connectable services from acces to the privatekey [10:14] what though if one app that has no internet touches your private key and then hands it to the other buddy app that has internet [10:15] then I'm compromised. [10:15] so does your apparmor increase security then? [10:15] i mean it seams like there is a way around it [10:15] it does. any intrusion vector shut down, even if not 100%, is increased security. security is not black and white, never 100%. it's a process. [10:16] given enough time and money, there's always a "way around", even the best security in the world. https://xkcd.com/538/ [10:16] cant one reduce any ssh activity to a life cd? [10:17] "life cd"? [10:17] like make a custom live cd of ubuntu make sure it is md5 checksumed and all, and then put the private key on that, bur it to disk and then onyl physical access will grant them access to the private key [10:17] who ever them is... [10:18] liek you only ssh into the server with this live cd and have noother copies of the private key than on the livecd itself [10:18] that's one way to make it more secure, yes [10:18] does this aproach have security holes too? [10:18] but then... openssh itself could be found (and has been in the past) vulnerable. [10:18] i see that if your original copy has been tempered with yes... [10:18] but you can md5 checksum to make sure [10:18] somewhat... [10:19] oh [10:19] so your remote machine is compromised, an openssh vuln exist, you connect to that machine, poof your keys are stolen. (hypothetically, if such vuln existed) [10:19] i mean you cant run a server off of a livecd [10:19] or can you? [10:20] so the bottom line is, you cover as many vectors as you can, but it's never 100%. there will alwys be something, somewhere, lurking, that can potentially compromise you. a visit from the attacker with a $5 wrench, included. [10:20] you can run read-only stateless servers yes. [10:20] wait why the live cd in the first place? cant you basically write a script that md5 checksum the system and asks you to sign off on any changes and maybe show those changes to you, sort of liek a firewall for making changes to the system [10:20] which may or may not be feasible depending on what they do [10:20] Not to mention, that there are all kinds of precautions you could take, but wouldn't neccesdarily be practical, since they would make your server less useful. [10:21] and if there is an unallowed change it reverts the system back with rsync [10:21] andol: indeed. [10:21] SlowJimmy: sure, check out AIDE [10:21] !info aid [10:21] !info aide [10:21] Package aid does not exist in bionic [10:21] aide (source: aide): Advanced Intrusion Detection Environment - static binary. In component main, is optional. Version 0.16-3 (bionic), package size 706 kB, installed size 1986 kB [10:21] blackflow well i just want to be reasonably secure the guy who made the effort to physically visit me at that point i am beate [10:21] beate [10:22] beaten [10:22] literally [10:22] this AIDE does add all kinds of paranoid security measures? [10:22] nice! [10:23] blackflow what book can i read to get on top of this? [10:23] no, it's essentially a database of checksums and various other file properties, and then you do frequent runs and it reports what changed about the files in the db. [10:23] liek to know where the weakess of my system are liek what you said earlier with the openssh vulnerabilites and such [10:23] like that md5 script you mentioned above, md5 being just one thing it does. [10:23] black omg that is sweet!!! [10:24] SlowJimmy: for THAT though, check out Snort. [10:24] !info snort [10:24] snort (source: snort): flexible Network Intrusion Detection System. In component universe, is optional. Version 2.9.7.0-5build1 (bionic), package size 678 kB, installed size 2148 kB [10:24] couldnt you combine this with your current ssh protection? [10:24] sure [10:24] check for any file changes evertime your ssh folder is accessed [10:24] * andol thinks SlowJimmy would benefit more from general sysadmin understanding, and less from specific tools. [10:25] Snort goes as far as monitoring traffic in real time and detecting patterns of known or potential malicious behavior [10:25] * blackflow agrees with andol [10:43] it is very soothing to lear about these tools though [10:44] to know there already is a way to deal with these issues [10:44] i am i the process of readig several gnu/linux server adming /network administration books [10:45] for any complex problem, there is always a more complex partial or full solution. ;) [10:45] or rather multiple, so you can spend more time on finding out which one is the least bad one. [10:46] lol [10:46] keeping you perpetually busy in the process [10:47] unless you notice you are and break the loop. so how long have you spent on these thoughts today? ;) [10:59] SlowJimmy: https://debian-handbook.info/ <-- good reading - you'll probably learn a lot - debian isn't ubuntu, but then, they're about the same (ubuntu is based on debian after all) [11:03] Yepp, great book! [11:03] RoyK yeah they all are so similar [11:04] thansk man i really apreciate your help [11:04] thanks blackflow thanks andol thanks tomreyn thansk RoyK [11:05] :) [16:17] Hey, I need some help - I want to run a script from systemd, which either operates with root privileges and has a password on it, or runs a single command with sudo [16:17] or remove the need to run that command with sudo [21:34] hello guys i need a little help. Just got a vps with 15.10. trying to install 16.04 through ssh but cant install update-manager-core [21:34] any suggestion on it? [21:35] the main problem during installing update-manager-core that it says "unmet dependecies: python3-update-manager [21:35] is not going to be installed" [21:35] !eolupgrades | Zahovay [21:35] Zahovay: End-Of-Life is the time when security updates and support for an Ubuntu release stop, see https://wiki.ubuntu.com/Releases for more information. Looking to upgrade from an EOL release? See https://help.ubuntu.com/community/EOLUpgrades [21:36] Zahovay: so the hosting company has no modern ubuntu images? [21:36] hosting company is old as hell, its also awful but its the cheapest by far [21:37] I'd still drop them if they don't support modern images. plenty of cheap but quality providers [21:38] anyway its already payed we didnt know its like that.. [21:38] which server version u suggest? [21:39] Zahovay: 18.04, latest LTS [21:39] does it have any drawbacks? [21:41] Zahovay: well personally I don't like the netplan NIH but it's nothing you can't remove/ignore/not use [21:41] or use it if you like it. [21:42] blackflow: and when i edit sources.list do I use old-releases with 18.04? [21:42] or archive? [21:43] oh that question is stupid im sorry [21:43] not with 18.04, you use that in your existing 15.10 in order to be able to upgrade [21:44] but if I were you, and that hoster had a "rescue mode", even if debian, I'd use that and install with debootstrap. in fact that's how I alwys install remotely because of encryption. [21:52] it says kernel version not supported. (upgrading with update-manager-core) any ideas? [21:52] well, rescue mode, debootstrap [21:52] Zahovay: how much are you paying for that thing? [21:53] half a dollar / month [21:54] well, pay peanuts, get monkeys :) the "cheap but quality" providers really start at around few €/mo [21:54] I know and I told my manager that this was the worst possible choices of all [21:54] "manager"? so this is for business purposes? [21:55] actually this is kind of a research labor of IOT and nobody has server side experience at all [21:56] I thought that I will try to setup the server by myself since I know c/cpp programming this setup could not take much work [21:57] shoud* [21:57] programmers are usually the worst sysadmins : [21:58] jokes aside, y'all should really consider hiring some help. [21:59] well I want to learn this part of the life too. I want to become kind of a security expert of the IOT part of IT [21:59] learning some server part should help me [21:59] that's perfectly fine. local VMs are best used for that. [22:00] agreed but the manager said that our work would be tracked through a website's database with visual diagrams etc.. so he choose this .. I accepted server side so i learn from it [22:01] welp, that's what grinds my gears. people wiht no experience running public servers that get compromised and turned into gbps UDP cannons for a botnet. [22:02] actually it is not going to be public server [22:02] i already restricted all ports and connections except my ssh which is not the default ssh [22:02] and database will be set to be used only from local access. (so the server program) [22:02] and I hope you disabled password auth in sshd_config? [22:02] i mean publicly available but only auth users will use it [22:03] wait, a db listening on public IP? [22:03] let me have a smoke and will continue [22:03] im courius about these [22:08] can i pm you? [22:09] please don't. [22:10] okey, so I would have a mysql database restricted to local access only with a pubic ip running a nodejs server serving connections [22:10] is this a bad idea? [22:11] not per se [22:17] after upgrading i've been dropped from sudoers file. Can I resolve it? [22:19] if root has password, try su -l and use root's password [22:22] usually root doesn't have a password on ubuntu, try "sudo -i" [22:24] RoyK: "dropped from sudoers file" [22:28] Well the guy who pays the vps is not active, i could not solved this.. Thanks for you help guys [22:29] blackflow: login on the console or use an usb thing [22:29] Zahovay: check if you have sudo priv anyway, maybe through %sudo group? or %wheel [22:30] I had sudo before upgrading. Now when I type "%sudo group" it says no such job [22:30] for wheel it says the same [22:30] Zahovay: lol... %sudo is notation for the "sudo" group in sudoers file [22:31] it's not a command [22:31] I cannot "cat" the sudoers file [22:31] permission denied [22:31] right. but can you sudo anything? sudo -i for example? [22:31] it asks for my pw then it says im not in the sudoers file [22:32] and "its going to be reported" [22:32] lol yeah, that's sudo the little snitch. you're lucky sudo on ubuntu is not compiled with insults. [22:32] anyway, does that hosting company have a rescue env? if you can mount the disk in the rescue env, you can change the sudoers file or assign root pass [22:33] Zahovay: is this a vm somewhere out in the cloud? [22:33] Well probably has, i have to wait 'til the guy who paid and have the access to everything wakes up and give me some login infos for the vps company's site [22:35] Can I check somehow the usernames on this vm ? [22:35] i mean on the ubuntu [22:36] Zahovay: check /etc/passwd [22:37] don't pastebinit [22:37] command worked but didnt help [22:38] Zahovay: it's a text file, /etc/passwd - it lists the users on the system [22:39] Zahovay: I won't help you to hack a system, just saying how things work [22:40] Actually this our own vps where I had root password on 15.10 and after upgrading to 16.04.5 (was 3 hours of work due to messed up sources.list) i lost my root priv [22:40] but I understand your point and I do not ask you to help me in such a thing [22:40] then 'su -' should give you root acesss [22:41] well it says auth failure [22:41] dunno why [22:41] or you may have to ask the supplier of the VPS [22:41] I will have to.. tomorrow when the guy who paid woke up.. [22:43] wait [22:43] im dumb [22:43] and it worked [22:43] thanks lol [22:43] fine :) [22:43] for that money, I doubt the hoster would even laugh. :) [22:43] i had to wrote my username after the su [22:43] ah thanks guys [22:43] uh... that just started a new shell as ..... you. [22:44] `whoami` will confirm [22:44] or "who am i" [22:44] like looking into a mirror [22:44] lol so it did not work [22:45] nope. `su -l` is to become root with root's pass. `sudo -i` the same but with your, sudoers, pass. [22:45] blackflow: or just "su -" [22:45] (it essentially being the same as `sudo su -l`) [22:46] RoyK: I like being explicit. [22:46] but, yes. [22:48] not sure if I understand but "su username" then pw it runs fine without error but I do not get any root priv. (I've alsod done "su username" then pw then whoami [22:48] Zahovay: "su" means "switch user" - if you don't give it a username, it means root [22:49] oh lol [22:49] https://xkcd.com/149/ [22:50] :DDDDDDDDDDDDD === havenstance1 is now known as havenstance