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
dont skimp on the shrimp
Apr 23, 2008

:coffee:

Martytoof posted:

I honestly think it's a toss-up between Fedora/CentOS and Ubuntu. They're both really well documented and while they're different package systems, etc., they're both pretty similar in terms of what they offer.
I think the most significant difference, besides the package manager, would be that fedora uses systemd, centos uses sysvinit (I think?) and ubuntu uses upstart.

Probably means jack poo poo to the average user though, but yeah.:)

Adbot
ADBOT LOVES YOU

some kinda jackal
Feb 25, 2003

 
 
Oh yeah. I guess there are significant differences under the hood. Good point.

Sort of wish they'd try to standardize on something.


Lukano posted:

It's been like 6-8 years since I last used it, but MyNetWatchman does all that and more, especially with some IDS in place.

http://www.mynetwatchman.com/

I used to run it on Smoothwall ages ago, keep meaning to see if I can get it running on OpenWRT but haven't had the time.

I will give this a long hard look, thank you :)

Lukano
Apr 28, 2003

Now that I've actually sat down and taken a look at the MNW website, it doesn't look like they've actively aggregated / identified / reported incidents since like Nov 2009. They still track firewall events, but they don't do anything with the data anymore :(

On the upside, the source to the mnwclient is there to poke at should someone want to pick up the torch I guess :P

ToxicFrog
Apr 26, 2008


quote:

Not to start an editor war, but in general, one of vim or emacs is really good to learn well. Learning curves are a bit steep, but I'm far more productive writing code in vim than any IDE I've used. The fact that I can just as trivially write code over a remote shell from any computer, using detachable screen sessions (or tmux, whatever) is icing on the cake.

Every time I hear someone say this it later transpires that they haven't used any IDEs since they learned to use vi ten/twenty/thirty years ago. Some of them are actually really good these days!

Although granted if you want something you can use over a slow SSH connection or can detach from pretty much anywhere, vi/emacs are boss.

All that aside, though - yeah, knowing the absolute basics of vi is a good idea. Nano/pico are easier to use, any graphical editor is easier still, but everything has vi installed. If you know how to load, edit, and save in vi, you will still have a working text editor you can use to fix things even when everything else is missing or broken.

(The one possible exception is space-constrained embedded systems; nano is much smaller than vi. But you don't really need to "learn" nano, it's very discoverable.)

evol262
Nov 30, 2010
#!/usr/bin/perl

Zom Aur posted:

I think the most significant difference, besides the package manager, would be that fedora uses systemd, centos uses sysvinit (I think?) and ubuntu uses upstart.

Probably means jack poo poo to the average user though, but yeah.:)

CentOS6 uses Upstart.

dont skimp on the shrimp
Apr 23, 2008

:coffee:

evol262 posted:

CentOS6 uses Upstart.
Ah, I had no idea. I just knew it hadn't switched to systemd yet. Thanks. :)

Sulla Faex
May 14, 2010

No man ever did me so much good, or enemy so much harm, but I repaid him with ENDLESS SHITPOSTING
What's the best way to manage an Ubuntu machine remotely, specifically the apache/php/mysql/fileserver elements? Webmin is apparently out of date and has been replaced, but I can't figure out with what..

madsushi
Apr 19, 2009

Baller.
#essereFerrari

Sulla-Marius 88 posted:

What's the best way to manage an Ubuntu machine remotely, specifically the apache/php/mysql/fileserver elements? Webmin is apparently out of date and has been replaced, but I can't figure out with what..

SSH.

Seriously though, I am not sure what replaced Webmin, I know a lot of people still using it. I use SSH for everything.

spankmeister
Jun 15, 2008






Sulla-Marius 88 posted:

What's the best way to manage an Ubuntu machine remotely, specifically the apache/php/mysql/fileserver elements? Webmin is apparently out of date and has been replaced, but I can't figure out with what..

Man up and use the shell, basically. :)

Sulla Faex
May 14, 2010

No man ever did me so much good, or enemy so much harm, but I repaid him with ENDLESS SHITPOSTING
The frustrating thing about using the shell is copy-pasting commands or code in.. if it's anything longer than 100 chars, it gets really frustrating to get stuff across from webpages or code snippets etc. That's why I prefer VNC or a server GUI to be able to bulk-add text.. how do you guys get around that? Do you just add the code to a file on your local machine and transfer from there, or what?

dont skimp on the shrimp
Apr 23, 2008

:coffee:

Sulla-Marius 88 posted:

The frustrating thing about using the shell is copy-pasting commands or code in.. if it's anything longer than 100 chars, it gets really frustrating to get stuff across from webpages or code snippets etc. That's why I prefer VNC or a server GUI to be able to bulk-add text.. how do you guys get around that? Do you just add the code to a file on your local machine and transfer from there, or what?
You could use X-forwarding if you only use the occasional graphical app. Or freenx, that's pretty good too I think.

Less Fat Luke
May 23, 2003

Exciting Lemon

Sulla-Marius 88 posted:

The frustrating thing about using the shell is copy-pasting commands or code in.. if it's anything longer than 100 chars, it gets really frustrating to get stuff across from webpages or code snippets etc. That's why I prefer VNC or a server GUI to be able to bulk-add text.. how do you guys get around that? Do you just add the code to a file on your local machine and transfer from there, or what?
What are you using to paste things? I never run not those problems with Putty.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

Sulla-Marius 88 posted:

The frustrating thing about using the shell is copy-pasting commands or code in.. if it's anything longer than 100 chars, it gets really frustrating to get stuff across from webpages or code snippets etc. That's why I prefer VNC or a server GUI to be able to bulk-add text.. how do you guys get around that? Do you just add the code to a file on your local machine and transfer from there, or what?

What kind of issues are you getting? I have had problems cutting+pasting unicode when the shell expects ascii and it just fucks everything up.

other people
Jun 27, 2004
Associate Christ
Can some one help me with my appalling lack of iptables knowledge?

New web host has some sort of monitor running that periodically pings my fancy new server to see if it is up. I learned about this just a few minutes after I setup iptables when I got an automated warning that my machine was unreachable and a ticket had been created and oh god bla bla bla...

So I googled around for an entry that would allow ICMP from a specific IP and came up with this:

code:
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22222 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -d 1.2.3.4/32 -p icmp -m icmp --icmp-type 8 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
-A OUTPUT -s 1.2.3.4/32 -p icmp -m icmp --icmp-type 0 -m state --state RELATED,ESTABLISHED -j ACCEPT
Where 1.2.3.4 is the IP of the heartbeat server thingie.

I felt pretty good about this until I got another email a few minutes later saying the sky was falling and my server had disappeared.

Some one hold my hand!

ToxicFrog
Apr 26, 2008


Sulla-Marius 88 posted:

The frustrating thing about using the shell is copy-pasting commands or code in.. if it's anything longer than 100 chars, it gets really frustrating to get stuff across from webpages or code snippets etc. That's why I prefer VNC or a server GUI to be able to bulk-add text.. how do you guys get around that? Do you just add the code to a file on your local machine and transfer from there, or what?

Generally I just open the file in nano or vi and paste the text.

If I need more involved editing, I (depending on circumstances and how much I need to do) might do any of:
- ssh in, use nano
- ssh -XC in, use a graphical editor
- mount over sshfs, use a local editor
- use NX + a graphical editor
- rsync everything to my local machine, edit it there, and rsync it back

ExcessBLarg!
Sep 1, 2001

Kaluza-Klein posted:

Can some one help me with my appalling lack of iptables knowledge?
1. ICMP echo is a meh heartbeat. It tells you that the machine is up, not that your server is operational. It might be better to have the heartbeat test an HTTP connect (or whatever tcp:80 is), since that wouldn't require any additional firewall rules and actually tests if the daemon is running.

2. You shouldn't need the "-A OUTPUT" rule at all, unless that's not your full firewall configuration and/or you're setting a DROP policy on the OUTPUT chain. If the latter, there's bigger problems here.

3. Your source/destination switches are swapped. What you really want is:
code:
iptables -A INPUT -s 1.2.3.4 -p icmp -j ACCEPT
Note the "-s" instead of the "-d".

4. Why not just accept ICMP traffic period? Dropping it is more likely to cause problems than it's going to solve. For one, if the monitor server is ever reIPed, you're going to have to update the firewall rule and will probably forget to. Or the guy who replaces you won't even know that rule is there and be baffled.

bimmian
Oct 16, 2008

Kaluza-Klein posted:

Can some one help me with my appalling lack of iptables knowledge?

New web host has some sort of monitor running that periodically pings my fancy new server to see if it is up. I learned about this just a few minutes after I setup iptables when I got an automated warning that my machine was unreachable and a ticket had been created and oh god bla bla bla...

So I googled around for an entry that would allow ICMP from a specific IP and came up with this:

code:
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22222 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -d 1.2.3.4/32 -p icmp -m icmp --icmp-type 8 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
-A OUTPUT -s 1.2.3.4/32 -p icmp -m icmp --icmp-type 0 -m state --state RELATED,ESTABLISHED -j ACCEPT
Where 1.2.3.4 is the IP of the heartbeat server thingie.

I felt pretty good about this until I got another email a few minutes later saying the sky was falling and my server had disappeared.

Some one hold my hand!


Here is my iptables entry for icmp:

code:
iptables -A INPUT -p icmp --icmp-type 8 -s 0/0 -d 10.10.12.23 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -p icmp --icmp-type 0 -s 10.10.12.23 -d 0/0 -m state --state ESTABLISHED,RELATED -j ACCEPT
Looks like you just have some things switched around. I believe the order of switches matters, at least for the first switch (-A in mine) as that defines what the rule will do (Add, drop etc).

ExcessBLarg!
Sep 1, 2001
Also, those firewall rules are bizarrely overspecified. I'm guessing you folks found them from here?

There's a few things about that page that bothers me. But one of which is the overspecified firewall rules without motivation. For example, why hardcode the destination IP? Is it to prevent smurf attacks? If so, Linux has been ignoring ICMP echo requests on the broadcast address by default since 2.6.14.

bimmian
Oct 16, 2008

ExcessBLarg! posted:

Also, those firewall rules are bizarrely overspecified. I'm guessing you folks found them from here?

There's a few things about that page that bothers me. But one of which is the overspecified firewall rules without motivation. For example, why hardcode the destination IP? Is it to prevent smurf attacks? If so, Linux has been ignoring ICMP echo requests on the broadcast address by default since 2.6.14.

I use a simpler rule most of the time now, I just happened to have an example that essentially matched his from when I was trying to familiarize myself with iptables. Helpful to specify that stuff just to see how the syntax works, though my use of linux in a production environment is limited to the single nagios server I'm responsible for.

Polygynous
Dec 13, 2006
welp

ExcessBLarg! posted:

Is it to prevent smurf attacks? If so, Linux has been ignoring ICMP echo requests on the broadcast address by default since 2.6.14.

So that's why that stopped working? I had a legitimate reason to want to do that once or twice and wondered why nothing happened anymore.

ExcessBLarg!
Sep 1, 2001

spoon0042 posted:

So that's why that stopped working?
Probably. /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts, which is the parameter that controlls that, defaults to 1 now. That said, distributions may have been setting that in their sysctl.conf for some time prior to that even.

Pinging broadcasts is a cheap way to figure out which machines on a subnet are up, but nmap can basically do the same thing with unicast addresses so there's not a huge functionality loss.

other people
Jun 27, 2004
Associate Christ
This "pinging to check if the server is up" is something the hosting service is doing, I had no idea it was there until it yelled at me!

I just gave up and allowed all ICMP.

And yes, ExcessBLarg!, I did find the rules I tried at that link!

I do have allow all output, so I realize now that the output rule for icmp was useless. The perils of copy/pasting :/.

This is just a server I can goof off with and idle on irc with, so hopefully no one is worried that I am learning on it.

spankmeister
Jun 15, 2008






I get that poo poo all the time at work.

"Please allow SSH access on someserver to someip"

*opens port

"It's not working! I can't ping!"


:rolleyes:

ExcessBLarg!
Sep 1, 2001

Kaluza-Klein posted:

This "pinging to check if the server is up" is something the hosting service is doing, I had no idea it was there until it yelled at me!
OK, so they're not checking for a specific service. In general, that kind of monitoring is a good thing. :)

Kaluza-Klein posted:

This is just a server I can goof off with and idle on irc with, so hopefully no one is worried that I am learning on it.
Fair enough.

A modern Linux system usually doesn't need a firewall. That said, stateful, "default deny" of incoming TCP/UDP traffic isn't bad. Just open the ports you need and that way you can run whatever daemons without worry that a misconfiguration gets you owned.

ICMP is pretty harmless though. I've never had a problem just allowing it, and I've not found good motivation for blocking it in most circumstances. I have, however, run into problems where things like PMTU discovery breaks because folks unnecessarily filter ICMP and it gets annoying.

spankmeister posted:

"It's not working! I can't ping!"
To be fair, I'd at least playfully give someone poo poo for blocking ICMP traffic for whitelisted hosts too.

Dilbert As FUCK
Sep 8, 2007

by Cowcaster
Pillbug
People weren't kidding when they said Centos Minimal install is basic.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

ExcessBLarg! posted:

A modern Linux system usually doesn't need a firewall. That said, stateful, "default deny" of incoming TCP/UDP traffic isn't bad. Just open the ports you need and that way you can run whatever daemons without worry that a misconfiguration gets you owned.

Sure it does. Anything on the internet should (most people are behind NAT at home so you could argue that those don't, but still should)

ExcessBLarg!
Sep 1, 2001

Bob Morales posted:

Sure it does.
Why?

What attack vector exists that non-firewalled, but properly-configured Linux machines are susceptible to?

I understand running a firewall on machines where semi-trusted users are running riff-raff services/programs that the world shouldn't have access to. I would go as far as to say that these machines should run a firewall. But if you're running a machine with limited services and no riff-raff users, why does it need a firewall?

spankmeister
Jun 15, 2008






Any users of Symantec / Veritas backup exec for Linux here?

From the server, what account do you use to connect to the clients?

I have a client set up but the thing is that the windows server backup manager program thing needs an account from the linux machine to access it. And I don't like using root for that, seems weird to have to store the root password in the backup application if the backup service is already running as root.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

ExcessBLarg! posted:

Why?

What attack vector exists that non-firewalled, but properly-configured Linux machines are susceptible to?

I understand running a firewall on machines where semi-trusted users are running riff-raff services/programs that the world shouldn't have access to. I would go as far as to say that these machines should run a firewall. But if you're running a machine with limited services and no riff-raff users, why does it need a firewall?

What if you install a piece of software that does something dumb like opening a service/port without you knowledge and you get attacked that way? If you have a firewall blocking that port, it doesn't matter if something is opened without your knowledge.

I understand that in most cases a non-open port is just as good as a firewalled port. But there's no reason to NOT run one just in case.

ExcessBLarg!
Sep 1, 2001

Bob Morales posted:

What if you install a piece of software that does something dumb like opening a service/port without you knowledge and you get attacked that way?
That's not a properly configured machine, and it's something that should never happen in a production environment.

In the past, there were systems that were vulnerable to attack merely by virtue of being online, and thus, in absence of timely patching, needed a firewall just to function.

That's no longer the case, you can put a properly-configured Linux machine online without a firewall, and it won't get owned by virtue of inherently running Linux. That's what I mean by need. That said, running a firewall may well be prudent depending on what one intends to do with the machine. But it should be considered as part of risk assessment, not something that absolutely has to be done.

Bob Morales posted:

I understand that in most cases a non-open port is just as good as a firewalled port. But there's no reason to NOT run one just in case.
For the most part I agree. The problem comes in when "running a firewall" means copying and pasting a bunch of feature-breaking iptables mumble without consideration of what much of it really means. For example, indiscriminate blocking of ICMP traffic because "nobody uses ICMP" or misguided assumptions of how these things actually serve as attack vectors.

Long story short, if I'm connecting to a host I should have access to, I expect it to:
  • Respond to pings.
  • Send ICMP errors on things like TTL expiration.
  • Participate in PMTU discovery.
  • Not drop fragmented packets.
Bad firewall configurations will break one or more of the above, which usually ends up in my pulling my hair out when I can't make poo poo work and I'm trying to diagnose why.

nonathlon
Jul 9, 2004
And yet, somehow, now it's my fault ...
As often happens, a weird problem that I don't even know where to start with.

Background: I've got this Rails app I've written for work, including a content-type that has attachments. These attachments need to be stored somewhere on the file system, so I got a directory created on our fileserver (/home/f0/html/saird) for this storage. Correct permissions given and everything.

I run the webapp, try to upload and store a file and the app errors out. No big surprise, had it working in dev but the production environment is a bit different and no doubt I have to configure it right. It's when I go looking at the storage dir that things get strange:
code:
% ls -lad /home/f0/html/saird
drw-r--r-- 3 paul apache 4096 Apr  3 15:47 /home/f0/html/saird
Okay, that seems about right ...

code:
% ls -la /home/f0/html/saird
total 0
?--------- ? ? ? ?            ? /home/f0/html/saird/.
?--------- ? ? ? ?            ? /home/f0/html/saird/..
?--------- ? ? ? ?            ? /home/f0/html/saird/stream20120403-12890-1o6kdxu.xls
?--------- ? ? ? ?            ? /home/f0/html/saird/system
That's not good. In fact, what does that even mean and how can it happen?

code:
% touch /home/f0/html/saird/foo.txt
touch: cannot touch `/home/f0/html/saird/foo.txt': Permission denied
So I no longer have perms on my own directory? Any ideas?

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

outlier posted:

That's not good. In fact, what does that even mean and how can it happen?

So I no longer have perms on my own directory? Any ideas?

http://stackoverflow.com/questions/541533/only-questionmarks-in-linux-dirlisting

Looks like a permissions error:

quote:

That happens when the user can't do a stat() on the files (which requires execute permissions), but can read the directory entries (which requires read access on the directory). So you get a list of files in the directory, but can't get any information on the files because they can't be read. :) If you have a directory which has read permission but not execute, you'll see this. Someone probably tried to protect the .ssh directory incorrectly - it should be "chmod 0700 .ssh/" and owned by the user which owns the homedir. More than likely, someone was following instructions for securing a .ssh file but applied it to a .ssh directory. :)

If you do a chmod 0600 or 0400 on any directory, you can easily reproduce this behavior. Add execute permission to the dir, and it'll work fine.

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

spankmeister posted:

Any users of Symantec / Veritas backup exec for Linux here?

From the server, what account do you use to connect to the clients?

I have a client set up but the thing is that the windows server backup manager program thing needs an account from the linux machine to access it. And I don't like using root for that, seems weird to have to store the root password in the backup application if the backup service is already running as root.

IIRC we have a local user on each machine with a different set of credentials and added it to the default beoper group that is created by the agent install process.

spankmeister
Jun 15, 2008






i barely GNU her! posted:

IIRC we have a local user on each machine with a different set of credentials and added it to the default beoper group that is created by the agent install process.

So the account it uses doesn't actually need to have any rights, just be able to log in and be in beoper?

I thought it would be enough, but wasn't sure. (The install doc says to use root :rolleyes:)

Ninja Rope
Oct 22, 2005

Wee.

outlier posted:

code:
% ls -lad /home/f0/html/saird
drw-r--r-- 3 paul apache 4096 Apr  3 15:47 /home/f0/html/saird

Try giving everyone execute access to the directory. And by "everyone" I mean chmod 755.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

Copying my lubuntu install from a lowly 250GB HD to a 750GB WD RE. So I'm watching GParted copy 227GB. Probably would have been faster to just create the partitions and just cp the files over, right? Since there's...maybe 6GB of actual data on the drive?

1h 44m left then I can cross my fingers and hope I can get grub installed right on the new drive. I'd just re-install but I'd end up spending 5 hours re-installing (and re-building) a whole list of Ruby gems and poo poo like that.

FISHMANPET
Mar 3, 2007

Sweet 'N Sour
Can't
Melt
Steel Beams

Bob Morales posted:

Copying my lubuntu install from a lowly 250GB HD to a 750GB WD RE. So I'm watching GParted copy 227GB. Probably would have been faster to just create the partitions and just cp the files over, right? Since there's...maybe 6GB of actual data on the drive?

1h 44m left then I can cross my fingers and hope I can get grub installed right on the new drive. I'd just re-install but I'd end up spending 5 hours re-installing (and re-building) a whole list of Ruby gems and poo poo like that.

First step should have been to shrink the partitions. Though what I do in these cases is dd the entire drive over, then reboot and let gparted resize the partitions.

etcetera08
Sep 11, 2008

Anyone have suggestions for a good Quake-style drop-down terminal? The built in terminal in Ubuntu is okay for light use but I miss hotkey drop-down like I can get with iTerm in OS X. (Oh god how I miss iTerm...)

Computer viking
May 30, 2011
Now with less breakage.

etcetera08 posted:

Anyone have suggestions for a good Quake-style drop-down terminal? The built in terminal in Ubuntu is okay for light use but I miss hotkey drop-down like I can get with iTerm in OS X. (Oh god how I miss iTerm...)
Yakuake, maybe? It's a kde app, and I don't use it myself, but it's been around for a while and get updates and so on.

Adbot
ADBOT LOVES YOU

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

spankmeister posted:

So the account it uses doesn't actually need to have any rights, just be able to log in and be in beoper?

I thought it would be enough, but wasn't sure. (The install doc says to use root :rolleyes:)

Yep. Pretty sure we arrived at that conclusion once we realized that's all that the installer did. The user will need a real shell though, they can't just be authenticatable.

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