Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
anthonypants
May 6, 2007

by Nyc_Tattoo
Dinosaur Gum

RFC2324 posted:

Never heard of this, but if you can create a file in the root then you should be able to do a sudo - passwd root and change it.
Yeah I can use init=/bin/bash to get out of their chroot jail, changing it isn't a problem, I wanted to know if that was a legit thing or if the root password is still set to some generic, possibly guessable, string.

xzzy posted:

No, if you blank out the root password in shadow you'll never be able to log into that account again.

Never heard of a magic file resetting the root password either, probably some IT hack that someone implemented and it made it to the internet. Seems like a horrible idea to me.
If some automated process changed the root password to a random string, wouldn't that also mean you'd never be able to log into that account again?

anthonypants fucked around with this message at 20:33 on Apr 21, 2017

Adbot
ADBOT LOVES YOU

xzzy
Mar 5, 2009

anthonypants posted:

If some automated process changed the root password to a random string, wouldn't that also mean you'd never be able to log into that account again?

Yep!

Which makes me think it's some kind of daemon someone wrote that looks for a special file, and if one is found, prompts on boot for a password reset.

anthonypants
May 6, 2007

by Nyc_Tattoo
Dinosaur Gum

xzzy posted:

Yep!

Which makes me think it's some kind of daemon someone wrote that looks for a special file, and if one is found, prompts on boot for a password reset.
What happens when you use sudo su - to log into a Linux account that doesn't have a password filled out in /etc/shadow, like any of your service accounts (postgres, apache, sshd, etc.)

RFC2324
Jun 7, 2012

http 418

anthonypants posted:

What happens when you use sudo su - to log into a Linux account that doesn't have a password filled out in /etc/shadow, like any of your service accounts (postgres, apache, sshd, etc.)

su will prompt for the password, which doesn't exist.

You can sudo su over to root tho

anthonypants
May 6, 2007

by Nyc_Tattoo
Dinosaur Gum

RFC2324 posted:

su will prompt for the password, which doesn't exist.

You can sudo su over to root tho
Uh, on every Linux system I've worked on, sudo gets you root, with your password, and then with those sudo-ed permissions you can su to whoever you want.

RFC2324
Jun 7, 2012

http 418

anthonypants posted:

Uh, on every Linux system I've worked on, sudo gets you root, with your password, and then with those sudo-ed permissions you can su to whoever you want.

Correct.

sudo allows you to execute commands as root with your password, including launching a new shell. su requires the password of the user you are switching to, instead of yours.

sudo su - would switch you to root with your password. su - will require the root password.

If you sudo or su as root to use another account, you will not be prompted for a password at all because you are root.

Taking all these things, if you use sudo to become root, you will succeed because your account has a valid password. If you try to use su to become root it will fail because the root account does not have a valid password set.

xzzy
Mar 5, 2009

You can't su to accounts (even as root) that have an invalid binary for its shell (/sbin/nologin or /bin/false are common for these cases).

RFC2324
Jun 7, 2012

http 418

xzzy posted:

You can't su to accounts (even as root) that have an invalid binary for its shell (/sbin/nologin or /bin/false are common for these cases).

I've always understood this to be the only real way to completely lock shell access, but what if I do a 'su --command=/bin/bash <user>' ? I just thought of it, and wonder if it would work.

Or even the much simpler 'su --shell=/bin/bash <user>'

xzzy
Mar 5, 2009

RFC2324 posted:

I've always understood this to be the only real way to completely lock shell access, but what if I do a 'su -c /bin/bash -u <user>' ? I just thought of it, and wonder if it would work.

-c won't get you in (it runs the command in a shell owned by the user), but -s will.

anthonypants
May 6, 2007

by Nyc_Tattoo
Dinosaur Gum

xzzy posted:

You can't su to accounts (even as root) that have an invalid binary for its shell (/sbin/nologin or /bin/false are common for these cases).
Okay, so, first of all, the password field in /etc/shadow is absolutely not the same thing as the shell in /etc/passwd. Second of all, those are two separate files.

RFC2324
Jun 7, 2012

http 418

anthonypants posted:

Okay, so, first of all, the password field in /etc/shadow is absolutely not the same thing as the shell in /etc/passwd. Second of all, those are two separate files.

This wasn't always true, and you can change it back to the old way of only having a passwd file!

But, if you change the shell in passwd to something invalid, it will prevent shell logins while still leaving the account enabled, which can be useful for things like having samba accounts managed in your passwd/shadow file without allowing those people the ability to gain a shell.

apropos man
Sep 5, 2016

You get a hundred and forty one thousand years and you're out in eight!
During the last couple of days deploying multiple CentOS guest systems I've noticed the tzdata always seems to be the heftiest update after install.

https://access.redhat.com/articles/1187353

Just out of curiosity what's it for? I gather it's something to do with collating all of the timestamps of various package updates, so it has to go through the entire range of packages in the repo or something like that?

Double Punctuation
Dec 30, 2009

Ships were made for sinking;
Whiskey made for drinking;
If we were made of cellophane
We'd all get stinking drunk much faster!
tzdata is IANA's timezone database that updates about every two months.

RFC2324
Jun 7, 2012

http 418

apropos man posted:

During the last couple of days deploying multiple CentOS guest systems I've noticed the tzdata always seems to be the heftiest update after install.

https://access.redhat.com/articles/1187353

Just out of curiosity what's it for? I gather it's something to do with collating all of the timestamps of various package updates, so it has to go through the entire range of packages in the repo or something like that?

Its just there so that your system knows how to handle timezones. As to why it gets so big, watch this video.

https://www.youtube.com/watch?v=-5wpm-gesOY

apropos man
Sep 5, 2016

You get a hundred and forty one thousand years and you're out in eight!
Hehe. Globalisation hasn't quite overtaken local tradition yet.

I'm subscribed to that channel. He has some educational stuff about floating point rounding errors and other general cryptography stuff.

Nulldevice
Jun 17, 2006
Toilet Rascal

RFC2324 posted:

Its a documented thing

https://access.redhat.com/documenta...pp_Macvtap.html

Are you using KVM or some other hypervisor? I know VMWare doesn't have this problem, I assume others can get around it too.

Maybe you aren't using the macvtap bridge?

I'm using a standard bridge interface. Not the macvtap or anything, no NAT, nothing special. There is no guest isolation or anything going on. Just always the way I've done it with the system using KVM.

Bridge interface config:

code:
[root@homenas network-scripts]# cat ifcfg-br0
DEVICE=br0
ONBOOT=yes
TYPE=Bridge
NM_CONTROLLED="no"
BOOTPROTO=none
IPADDR=192.168.1.246
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
STP=on
DELAY=0
DNS1=192.168.1.1
DNS2=8.8.8.8
And the physical interface:

code:
[root@homenas network-scripts]# cat ifcfg-eth1
DEVICE="eth1"
HWADDR=D0:50:99:26:FC:FA
ONBOOT=yes
BRIDGE=br0
Then the br0 shows up in the available bridge interfaces in the virt-manager program and is allowed to be used to attach interfaces to. Able to see other VMs and the host system just fine.

RFC2324
Jun 7, 2012

http 418

Dear god I missed something simple. Time to start trying to rebuild my entire lab network.

Roargasm
Oct 21, 2010

Hate to sound sleazy
But tease me
I don't want it if it's that easy

RFC2324 posted:

Correct.

sudo allows you to execute commands as root with your password, including launching a new shell. su requires the password of the user you are switching to, instead of yours.

and this is why you never use 'sudo !!'

Mr. Fix It
Oct 26, 2000

💀ayyy💀


Roargasm posted:

and this is why you never use 'sudo !!'

'sudo !!' is fine if you have the shell set to expand history references before executing and check it. Def agreed if you don't set that, but why would you?

Roargasm
Oct 21, 2010

Hate to sound sleazy
But tease me
I don't want it if it's that easy
Coming in as a windows admin, I never differentiated between running with root and running as admin. Pretty important distinction and worth a reminder for anyone just learning sudo :)

Furism
Feb 21, 2006

Live long and headbang
I'm trying to setup something simple. I took me 5 minutes under CentOS but I can't understand why I can't get it to work on Ubuntu.

I want to run AWStats through nginx on Ubuntu Server 16.04. I'm using fast_cgi and PHP7 FPM. But when I try to reach the page it just takes abnormally long and it just times out. Is there any up-to-date guide for this somewhere? I just could find any (they usually use Apache) and this is bugging me to no end.

E: I should note that the php7-fpm process takes 99.9% of the CPU when this happens so I'm not sure if the timeout is simply due to something taking a lot of resources for some time or if it's just going through some endless loop.

Furism fucked around with this message at 09:20 on Apr 26, 2017

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

Furism posted:

I'm trying to setup something simple. I took me 5 minutes under CentOS but I can't understand why I can't get it to work on Ubuntu.

I want to run AWStats through nginx on Ubuntu Server 16.04. I'm using fast_cgi and PHP7 FPM. But when I try to reach the page it just takes abnormally long and it just times out. Is there any up-to-date guide for this somewhere? I just could find any (they usually use Apache) and this is bugging me to no end.

E: I should note that the php7-fpm process takes 99.9% of the CPU when this happens so I'm not sure if the timeout is simply due to something taking a lot of resources for some time or if it's just going through some endless loop.
Isn't AWStats a Perl program?

LochNessMonster
Feb 3, 2005

I need about three fitty


Vulture Culture posted:

Isn't AWStats a Perl program?

Yes, but that's why he's using fast_cgi?

Furism
Feb 21, 2006

Live long and headbang

LochNessMonster posted:

Yes, but that's why he's using fast_cgi?

Correct! Or trying to, really.

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

LochNessMonster posted:

Yes, but that's why he's using fast_cgi?
Yeah, the question was about why PHP7 FPM is involved (which in retrospect is probably the right way to interpret Furism's question too).

JHVH-1
Jun 28, 2002
I think these would still be relevant. The php back end version shouldn't have any impact really:

http://kamisama.me/2013/03/20/install-configure-and-protect-awstats-for-multiple-nginx-vhost-on-debian/
https://wiki.archlinux.org/index.php/awstats

I'm just surprised awstats still exists.

Furism
Feb 21, 2006

Live long and headbang
These are the exact guides I've used (including their cgi-bin.php code) but the FGM just hangs, hogging 100% of the process until it times out.

I like awstats because, since it just reads the logs, it's 100% "passive" ; ie; visitors can't block it (like they might with Google Analytics or even Piwik). But if there are any newer software similar in its approach as awstats, I'm all ears!

Ellie Crabcakes
Feb 1, 2008

Stop emailing my boyfriend Gay Crungus

mike12345 posted:

Is imagemagick still the go-to program for batch-processing? Or maybe there's something better/leaner nowadays, haven't looked at that stuff for years.
Comedy Answer: GraphicsMagick

Experto Crede
Aug 19, 2008

Keep on Truckin'
I have a dedi box with server4you and ordered an extra IP. I want to use this for running a small kvm guest. Adding the IP to the server works fine, but adding it to the guest is less successful.

Apparently my provider's network doesn't support bridging. So the usual approach to setup a bridge on the host and adding the IP in the guest's config won't work.

Is there a way of doing this without hacking at NAT and stuff? I tried using macvtap but I'm presumably doing it wrong because I still can't get the network on the guest working.

other people
Jun 27, 2004
Associate Christ

Experto Crede posted:

I have a dedi box with server4you and ordered an extra IP. I want to use this for running a small kvm guest. Adding the IP to the server works fine, but adding it to the guest is less successful.

Apparently my provider's network doesn't support bridging. So the usual approach to setup a bridge on the host and adding the IP in the guest's config won't work.

Is there a way of doing this without hacking at NAT and stuff? I tried using macvtap but I'm presumably doing it wrong because I still can't get the network on the guest working.

What about the provider network prevents bridging? Do you just have to ensure STP is off on the bridge or will their switchport freak out if it sees more than one incoming MAC or what?

Paul MaudDib
May 3, 2006

TEAM NVIDIA:
FORUM POLICE
Handbrake is already in the Ubuntu 16.04/Xenial repositories but it's an ancient 0.10.2 release. I added the stebbins/handbrake-releases PPA, did apt-get update, and "apt-cache show handbrake" is still showing the 0.10.2 release. How do I force apt to prefer the PPA over the master repo?

edit: I was looking at the wrong package (handbrake instead of handbrake-cli) but pinning repo priority would appear to be the fix.

Paul MaudDib fucked around with this message at 04:01 on Apr 28, 2017

lllllllllllllllllll
Feb 28, 2010

Now the scene's lighting is perfect!
Is there still a modern Ubuntu or similarly easy to use distro that still fits on a CD with either Firefox or Chrom(ium) and runs from CD? This is for my dad who needs a virus-free OS with browser, so it should have a graphical OS and be fiddle-free (I can't be there to to fiddle with it). That would be great.

Furism
Feb 21, 2006

Live long and headbang

lllllllllllllllllll posted:

Is there still a modern Ubuntu or similarly easy to use distro that still fits on a CD with either Firefox or Chrom(ium) and runs from CD? This is for my dad who needs a virus-free OS with browser, so it should have a graphical OS and be fiddle-free (I can't be there to to fiddle with it). That would be great.

Does it have to be a CD though? You could probably use a read-only SD card or a USB drive.

Experto Crede
Aug 19, 2008

Keep on Truckin'

other people posted:

What about the provider network prevents bridging? Do you just have to ensure STP is off on the bridge or will their switchport freak out if it sees more than one incoming MAC or what?

Not sure, but every sort of fiddling with bridging I've done hasn't worked. Bridge device works fine just on its own, but can't get it to let servers accept the new IP.

I tried undoing the bridge and setting a VM to use passthrough to the ethernet device but that just crashes networking, as well as all the other methods I tried just not working.

So not sure what I can do to get this VM on this IP.

lllllllllllllllllll
Feb 28, 2010

Now the scene's lighting is perfect!

Furism posted:

Does it have to be a CD though? You could probably use a read-only SD card or a USB drive.
These exist, don't they? I guess I'll order one of those then. Thanks!

\/ e: Thanks, apropos man. I appreciate the effort. :)

lllllllllllllllllll fucked around with this message at 07:34 on Apr 29, 2017

apropos man
Sep 5, 2016

You get a hundred and forty one thousand years and you're out in eight!
If you're running a Linux environment yourself it's really easy to make a bootable USB from a stick you have lying around. No need to order something, just download an iso image, put the USB in and find out where it's mounted with this:

$ lsblk

Let's say that it's mounted at /dev/sdb1 and your iso file is in Downloads directory:

Do:

$ sudo unmount /dev/sdb1
$ sudo dd if=Downloads/isofile.iso of=/dev/sdb bs=1M

Leave it for a good length of time (10 minutes) and unmount or just pull it out.

Whichever iso you use is up to you. There are plenty that run from USB. Probably best to use an 8GB stick, though you might get away with a 4GB one.

Edit: the second line of bash should read:

$ sudo umount /dev/sdb1

I was posting on my phone: foiled by autocorrect!

apropos man fucked around with this message at 06:25 on Apr 29, 2017

anthonypants
May 6, 2007

by Nyc_Tattoo
Dinosaur Gum
I don't even think you can buy 8GB usb sticks anymore.

Docjowles
Apr 9, 2009

anthonypants posted:

I don't even think you can buy 8GB usb sticks anymore.

I still see random poo poo-tier flash drives in the checkout line at the grocery store or Best Buy or whatever. Or as conference swag from vendors who aren't even trying that goes directly into the trash.

As a geriatric who grew up on 5 1/4" floppies, it's kind of amusing to think of how many feet tall the stack of disks would be to match the 4GB USB stick I unthinkingly toss aside.

RFC2324
Jun 7, 2012

http 418

I remember thinking a 32mb usb drive was insane.

Adbot
ADBOT LOVES YOU

xzzy
Mar 5, 2009

I still have a usable 32mb flash drive, it has freedos on it and we use it to run dos only tools on our servers (usually raid controllers dumping diag info for the vendor because of course they'd never want to make linux friendly tools, no one ever uses linux in server environments).

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply