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:

Bob Morales posted:

Yea, I started searching for some sort of shellcode.

It's pretty up to date, though.
debian_version is 6.02
Kernel 2.6.32-5-686

I have gcc and everything so I should be able to find something.
Tricky situation. You can't just set SHELL to /bin/bash and use su -m?

(I don't think it'll work, but still)

Adbot
ADBOT LOVES YOU

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!

Zom Aur posted:

Tricky situation. You can't just set SHELL to /bin/bash and use su -m?

(I don't think it'll work, but still)

If the target user has a restricted shell, this option has no
effect (unless su is called by root).


If I try to su with the wrong password:

bob@server:~$ su
Password:
su: Authentication failure

If I su with the right password:

bob@server:~$ su
Password:
Cannot execute /bin/nologin: No such file or directory

ssh login by root is (stupidly) enabled, but of course:

Bobs-MacBook-Pro:~ $ ssh root@server
root@server's password:
Permission denied, please try again.

Same goes for scp

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!

I'm almost thinking if I can somehow setuid an editor, or change permissions on a file somewhow...I have the root password, I just can't get a drat shell. Are there any editors that let you edit a file, regardless of permissions that doesn't rely on sudo?

Sneaking Mission
Nov 11, 2008

edit: oh I missed where you said you tried using -s that. sorry. hmmm tricky situation

Sneaking Mission fucked around with this message at 19:14 on Jul 9, 2011

dont skimp on the shrimp
Apr 23, 2008

:coffee:

Bob Morales posted:


If the target user has a restricted shell, this option has no
effect (unless su is called by root).


If I try to su with the wrong password:

bob@server:~$ su
Password:
su: Authentication failure

If I su with the right password:

bob@server:~$ su
Password:
Cannot execute /bin/nologin: No such file or directory

ssh login by root is (stupidly) enabled, but of course:

Bobs-MacBook-Pro:~ $ ssh root@server
root@server's password:
Permission denied, please try again.

Same goes for scp
Ah, seems the arch man is different. :/

I guess you could try to append the current shell (/bin/nologin) to /etc/shells, and after that --shell should work to change shells.

That still leaves us in the same situation; how do we edit /etc/shells without logging in as root, one way or another?

A package upgrade could do it, I suppose, if you have automatic updates that doesn't use signed packages, but that would be terribly loving stupid.

angrytech
Jun 26, 2009
SH/SC Let's Play: Lets crack Linux!

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!

I can still access the box, I just can't do any root stuff for it. I guess I'm stuck waiting for a exploit to hit Debian (hell, I can't update the box so it should be vulnerable...)

hackedaccount
Sep 28, 2009
maybe try fiddling with /bin/sulogin

EDIT: might as well ask: can you ssh in with a command ssh root@foobar 'chmod 777 /etc/passwd' (or something less crazy but still non-interactive)

hackedaccount fucked around with this message at 08:01 on Jul 10, 2011

spankmeister
Jun 15, 2008






How hard is it to get physical access? Booting into single user by setting init=/bin/bash should avoid this problem and allow you to fix.

spankmeister
Jun 15, 2008






Edit: my phone farted, sorry.

kyuss
Nov 6, 2004

Question 1: as a happy user of "screen", I often find myself working at runlevel 3 for a while, and then switching to runlevel 5 now and then. However, I'm unable to reconnect to a screen I started at runlevel 3 while in xterm on runlevel 5. Any ideas how to do this?

Question 2: I have a beefy DB2 (linux) server at work that performs abysmally and I may be tasked to fix this some day. It's a setup from last year, with 16 SAS disks configured as RAID6 and ample RAM. However, it's response times are considerably slower than the old system it it supposed to replace, with virtually no load on it.

So this reeks of an elementary config problem to me, however I know next to nothing about db2 and database servers. Any input where I may start in resolving this mess?

Thank you.

spankmeister
Jun 15, 2008






kyuss posted:

So this reeks of an elementary config problem to me, however I know next to nothing about db2 and database servers. Any input where I may start in resolving this mess?

Thank you.
Blame the DBA.

bort
Mar 13, 2003

kyuss posted:

Question 1: as a happy user of "screen", I often find myself working at runlevel 3 for a while, and then switching to runlevel 5 now and then. However, I'm unable to reconnect to a screen I started at runlevel 3 while in xterm on runlevel 5. Any ideas how to do this?
screen -list and then connect to the particular session, e.g. screen -r pts-0

BlackMK4
Aug 23, 2006

wat.
Megamarm
How would I go about accomplishing a bridge like this:

pfSense Router - 5 port GBit NIC (all ports in use) - Linux File Server - Four different devices

The linux file server has a GBit NIC for normal use, but it also has two dual port Intel 10/100 NICs. I want to connect the four devices to the ports on the 10/100 NICs but bridge the traffic over to the GBit NIC. Can I even do this? I don't care about speed, I'm just trying to save a little money (lol $30) and learn.

BlackMK4 fucked around with this message at 20:23 on Jul 10, 2011

enotnert
Jun 10, 2005

Only women bleed

BlackMK4 posted:

How would I go about accomplishing a bridge like this:

pfSense Router - 5 port GBit NIC (all ports in use) - Linux File Server - Four different devices

The linux file server has a GBit NIC for normal use, but it also has two dual port Intel 10/100 NICs. I want to connect the four devices to the ports on the 10/100 NICs but bridge the traffic over to the GBit NIC. Can I even do this? I don't care about speed, I'm just trying to save a little money (lol $30) and learn.

http://www.linux.com/archive/feature/133849

telcoM
Mar 21, 2009
Fallen Rib

kyuss posted:

Question 2: I have a beefy DB2 (linux) server at work that performs abysmally and I may be tasked to fix this some day. It's a setup from last year, with 16 SAS disks configured as RAID6 and ample RAM. However, it's response times are considerably slower than the old system it it supposed to replace, with virtually no load on it.

spankmeister posted:

Blame the DBA.
Snarky but pretty much true: the configuration of the database itself can have a huge effect on its performance. For example, if the old database includes indexes that are appropriate for the most common queries and the new database has no indexes at all generated yet, that could easily drag the performance of the new system down to the dirt.

For a serious analysis, more information would be good. What is the type/model of the RAID controller? Is it a real hardware-accelerated RAID controller, or is RAID6 implemented at the driver level, and the hardware is just a "basic" SAS controller?

If it is a real hardware RAID controller, does it include a write cache unit?
A hardware RAID write cache includes some amount of very fast RAM, and typically either a back-up battery or a set of capacitors and Flash memory chips to protect the cached data if the system suddenly loses power. At least on HP Proliant servers, such a cache unit tends to be optional, but leaving it out can dramatically reduce the performance of the RAID controller.

What's the access pattern of your application like? In other words, what is the use of the database like?
  • write-mostly, with only infrequent queries (= a write cache unit would help a lot)
  • read-mostly, with only some writes/updates here and there (= improperly-configured indexes would cause extreme suckitude)
  • reading and writing about equally

How is the disk space allocated? You said you have 16 disks - are they configured as one big RAID6 set, or as two or three sets according to the purpose: one set for data, another for archive logs, and maybe a third for indexes.

Optimally, you'll want an independent RAID set for logs, so that the read/write heads can spend most of their time near the area where the last log entry was written (since the next one will usually be written immediately after them), and as many read/write heads as possible for the data and indexes, so that there will be more opportunities to parallelize multiple operations.

hackedaccount
Sep 28, 2009
gotta agree with telcoM because I have yet to see a DB where the OS or hardware configuration was the bottleneck. it is always the DB, but just like the networking guys the DB guys either A) weren't smart enough to figure it out B) wouldn't admit it was their problem C) wouldn't give me read-only access to look at how it's set up or D) all of the above

use iotop or just top. is the writer process at 100% utilization or is waiting on I/O often?

nitrogen
May 21, 2004

Oh, what's a 217°C difference between friends?

Bob Morales posted:

I hosed UP REAL BAD

Somewhere along the line, I changed my root user shell to /bin/nologin :haw:

It's a Debian box, there's no sudo. I can still login as other users. I can't scp or ssh in, and doing 'su -c whatever' or 'su -s /bin/sh' doesn't do anything (like the man page says)

Any ideas? It's a remote box otherwise I'd just drive to the office and fix it by hand.

How can I modify the /etc/passwd file, or run an editor as the root user?

Do you have a backup/restore client running on it as root? If so, just backup /etc/password from another box, edit it properly, and restore it.

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!

nitrogen posted:

Do you have a backup/restore client running on it as root? If so, just backup /etc/password from another box, edit it properly, and restore it.

Nope, it's just a basic server that I use to idle on IRC and stuff.

chiyosdad
May 5, 2004

"I wish I were a bird!"
ssh traffic is encrypted, right? I'm in China right now and using ssh to tunnel my http traffic, but I still can't access facebook and youtube for some reason (they are blocked here). The connection just times out. Any ideas?

kyuss
Nov 6, 2004

bort posted:

screen -list and then connect to the particular session, e.g. screen -r pts-0

Well I'll be damned, it just works. Must have hosed up somewhere else along the way for having problems with it.


telcoM posted:

For a serious analysis, more information would be good. What is the type/model of the RAID controller? Is it a real hardware-accelerated RAID controller, or is RAID6 implemented at the driver level, and the hardware is just a "basic" SAS controller?

If it is a real hardware RAID controller, does it include a write cache unit?

What's the access pattern of your application like? In other words, what is the use of the database like?

How is the disk space allocated? You said you have 16 disks - are they configured as one big RAID6 set, or as two or three sets according to the purpose: one set for data, another for archive logs, and maybe a third for indexes.

Thank you so much for your input, I'll deliver as soon as I get to it.

hackedaccount posted:

use iotop or just top. is the writer process at 100% utilization or is waiting on I/O often?

Those will be my first steps. Thank you guys :)

spankmeister
Jun 15, 2008






chiyosdad posted:

ssh traffic is encrypted, right? I'm in China right now and using ssh to tunnel my http traffic, but I still can't access facebook and youtube for some reason (they are blocked here). The connection just times out. Any ideas?

Yes it is, but your browser resolves the adresses using the local DNS.

You need to tunnel your DNS traffic as well. You can do this with firefox. I posted a howto earlier in the thread.

BTW: This means that the Chi-nese gubmint can track you until you start tunneling the DNS as well.

bort
Mar 13, 2003

spankmeister posted:

I posted a howto earlier in the thread.
http://www.webhostingtalk.com/showthread.php?t=539067

\/ \/ :niggly:

bort fucked around with this message at 13:17 on Jul 11, 2011

spankmeister
Jun 15, 2008







That's right but I was referring to this :) :

spankmeister posted:

Then, configure your browser to forward DNS requests through the proxy for complete stealthiness. I only know how to do this for Firefox: Type about :config in the address bar and change the "network.proxy.socks_remote_dns" string to "true".

Now you are completely proxied.

chiyosdad
May 5, 2004

"I wish I were a bird!"
That was it, thanks!

spankmeister
Jun 15, 2008






chiyosdad posted:

That was it, thanks!

No problem.

Might be worth setting the system DNS to something else than your internet provider (if possible) because all other programs that use the internet will resolve their DNS locally.

You could use OpenDNS, or google's DNS service

(Google has 8.8.8.8 and 8.8.4.4)

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!

What are you guys running that aren't using Fedora/Ubuntu?

Anyone out there using Bodhi, is Arch as popular as it seems?

spankmeister
Jun 15, 2008






I've used Arch in the past, I still use Debian on a few systems and I have one FreeBSD system (but that's not Linux ofc).

At work I mainly use RHEL 5 and 6.

e: Oh yeah my laptop runs Mint.

Computer viking
May 30, 2011
Now with less breakage.

Bob Morales posted:

What are you guys running that aren't using Fedora/Ubuntu?

Anyone out there using Bodhi, is Arch as popular as it seems?

One of my laptops runs debian testing, and my workstation (at work, ofc) runs FreeBSD.

dont skimp on the shrimp
Apr 23, 2008

:coffee:

Bob Morales posted:

What are you guys running that aren't using Fedora/Ubuntu?

Anyone out there using Bodhi, is Arch as popular as it seems?
I run arch on three computers, one which is a minecraft server, and debian on a gateway I built for someone else.

brc64
Mar 21, 2008

I wear my sunglasses at night.
Since I'm fairly new to this, can somebody give me a rundown of the importance of patching/updating software in Linux? I've noticed that when I log in (Ubuntu Server 11.04) I now have a notice:

52 packages can be updated.
9 updates are security updates.


Now, the server is solely for use on my LAN and I have no plans to make any part of it public facing, so I'm not hugely worried about security here, but again, part of the reason for building this server is to learn. Is it generally considered safe and encouraged to keep your packages up-to-date, or is the "if it ain't broken" attitude more prevalent here?

And finally, if I decide I want to update all my packages, is it just...

sudo apt-get upgrade

...then watch the magic happen?

spankmeister
Jun 15, 2008






brc64 posted:

Since I'm fairly new to this, can somebody give me a rundown of the importance of patching/updating software in Linux? I've noticed that when I log in (Ubuntu Server 11.04) I now have a notice:

52 packages can be updated.
9 updates are security updates.


Now, the server is solely for use on my LAN and I have no plans to make any part of it public facing, so I'm not hugely worried about security here, but again, part of the reason for building this server is to learn. Is it generally considered safe and encouraged to keep your packages up-to-date, or is the "if it ain't broken" attitude more prevalent here?
Generally speaking, don't fix what ain't broken, but install security patches.

Besides, package management in all modern distro's (especially Debian-based like Ubuntu) is so good that if you use it as a desktop or non-critical server you can generally just upgrade everything and not worry about it.

quote:

And finally, if I decide I want to update all my packages, is it just...

sudo apt-get upgrade

...then watch the magic happen?

Yup, but don't forget to do apt-get update first.

Underflow
Apr 4, 2008

EGOMET MIHI IGNOSCO

Bob Morales posted:

What are you guys running that aren't using Fedora/Ubuntu?

Anyone out there using Bodhi, is Arch as popular as it seems?

Slackware all the way since 1996. Running various older releases on relicts like a 386SX laptop, 386SX luggable, PII desktop, PIII laptop; and now a Sempron desktop. Some of those machines have alternative O/S's, mostly Open- and FreeBSD.

Personally, I think there's an elegance to Slackware, as well as a sometimes surprising flexibility; e.g. when making a 10yr old package work with a current system. Configuration is a joy, 'cause it's all accessible from the CLI.

I've tried Red Hat, Fedora, Mandriva, SuSE (not bad, but I thought Yast was terrible), Knoppix, Caldera, a mini-Ubuntu on a netbook (seemed OK), and Yggdrasil, but to me Slackware can't be beat for stability and reasons already mentioned.

I sure hope Volkerding continues the distro, and I always buy the complete set of discs for any release that's going to spend more than 6 months on my main system, which is basically all of them, 'cause there's little reason to upgrade often.

brc64
Mar 21, 2008

I wear my sunglasses at night.

spankmeister posted:

Generally speaking, don't fix what ain't broken, but install security patches.

Besides, package management in all modern distro's (especially Debian-based like Ubuntu) is so good that if you use it as a desktop or non-critical server you can generally just upgrade everything and not worry about it.


Yup, but don't forget to do apt-get update first.

Is there a simple way to install only the security updates? It looks like apt-get upgrade will just grab everything.

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!

brc64 posted:

Is there a simple way to install only the security updates? It looks like apt-get upgrade will just grab everything.

Comment out the lines that aren't 'security.ubuntu....' whatever in your sources.lst

bort
Mar 13, 2003

brc64 posted:

Is there a simple way to install only the security updates? It looks like apt-get upgrade will just grab everything.
I say grab everything unless you have a good reason not to. If you're doing heavy development and worry about language or library changes, or you're running an application server that services your business, then maybe you have a good reason for freezing your versions and sticking to security updates. If it's a machine to screw around on, new packages aren't going to break anything. If they do, you get to learn something.

angrytech
Jun 26, 2009

brc64 posted:

Is there a simple way to install only the security updates? It looks like apt-get upgrade will just grab everything.

Honestly I wouldn't worry about it. I've been using Ubuntu for going on 6 years and debian for 7; not once have I ever broken anything by updating.
Actually, I take that back, I sometimes broke X back when the video drivers were shittier, but that hasn't been an issue in years.

dolicf
Sep 12, 2010
Chiming in another vote for just update everything.

Version locking, point releases and change management type stuff is all pretty much only necessary in enterprise environments where the servers literally are mission critical. Think of large companies that are only online stores and their entire business doesn't function if they have problems.

spankmeister
Jun 15, 2008






Yeah I should add that I just update everything at home too.

On my enterprise environments at work I install just security patches generally.

Adbot
ADBOT LOVES YOU

brc64
Mar 21, 2008

I wear my sunglasses at night.
Alrighty, upgrading away. I've got to admit, this package management system is pretty sexy.

The server exists almost solely to store media and stream to various devices. I'm currently in the process of trying to get PS3 Media Server to work on it, but it's a bit difficult... there's no real definitive guide for configuring and running PMS (lovely acronym) on a headless server, so I'm trying to figure it out as I go.

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