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
Alfajor
Jun 10, 2005

The delicious snack cake.
I deleted a user that no longer works with us from a Ubuntu server.
10 minutes later, I found a folder that apparently he had ownership of, and I can't get into it or do anything with it... and I need to get into it.

code:
na@gond:/mnt$ ls -la
total 8
drwxr-xr-x  3 root root 4096 2007-12-05 12:50 .
drwxr-xr-x 21 root root 4096 2007-11-20 13:33 ..
?---------  ? ?    ?       ?                ? backup
The folder in question is backup, and I have no clue how to go about getting into it.

I tried a "sudo chown na:admin backup"
But I got an error saying "chown: cannot access `backup': Input/output error"

Halp guyz :ohdear:

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!

Maybe backup isn't mounted?

NZAmoeba
Feb 14, 2005

It turns out it's MAN!
Hair Elf
I have a box running Kubuntu that I want to constantly display a series of webpages, looping through a list of addresses, sort of like a powerpoint presentation on auto, but retrieving the pages each time as they will get updated etc. What's the simplest way to do this, I couldn't figure out a way to google it in a precise way.

Vulture Culture
Jul 14, 2003

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

Alfajor posted:

I deleted a user that no longer works with us from a Ubuntu server.
10 minutes later, I found a folder that apparently he had ownership of, and I can't get into it or do anything with it... and I need to get into it.

code:
na@gond:/mnt$ ls -la
total 8
drwxr-xr-x  3 root root 4096 2007-12-05 12:50 .
drwxr-xr-x 21 root root 4096 2007-11-20 13:33 ..
?---------  ? ?    ?       ?                ? backup
The folder in question is backup, and I have no clue how to go about getting into it.

I tried a "sudo chown na:admin backup"
But I got an error saying "chown: cannot access `backup': Input/output error"

Halp guyz :ohdear:
Your filesystem, and possibly your disk, is broken -- a folder owned by a nonexistent user will just show the owner as a UID/GID pair. Check dmesg to make sure you're not picking up disk I/O errors, then back up (lol) and fsck.

NZAmoeba
Feb 14, 2005

It turns out it's MAN!
Hair Elf

NZAmoeba posted:

I have a box running Kubuntu that I want to constantly display a series of webpages, looping through a list of addresses, sort of like a powerpoint presentation on auto, but retrieving the pages each time as they will get updated etc. What's the simplest way to do this, I couldn't figure out a way to google it in a precise way.

This is starting to become more of a scripting question than a linux one but I'll try my luck anyway.

I've got the following in a html/javascript that seems to do the job well enough:
code:
<html>
      <head>

<script type="text/javascript">
var pages = [
"http://google.com",
"http://yahoo.com",
"http://cnn.com"
];
var currentIndex = -1;
function startCycle() {
    var iframe = document.getElementById("iframe1");
    currentIndex = (++currentIndex) % pages.length;
    iframe.onload = function() {
        window.setTimeout(startCycle, 20000); //Currently set to change every 5 seconds
    }
    iframe.src = pages[currentIndex];
}
window.onload = startCycle;</script>
      </head>
      <body>
            <iframe  id="iframe1"  frameborder="0"  vspace="0"  hspace="0"  marginwidth="0"  

marginheight="0"
                  width="1200"  scrolling="yes"  height="800">
            </iframe>
      </body>
</html> 
The only missing element is that I need it to scroll slowly up and down the page until it refreshes to the next one, any idea how I do that? I know nothing about javascript.

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!

NZAmoeba posted:

The only missing element is that I need it to scroll slowly up and down the page until it refreshes to the next one, any idea how I do that? I know nothing about javascript.

Come on dude, Google for 30 seconds

http://www.mediacollege.com/internet/javascript/page/scroll.html

NZAmoeba
Feb 14, 2005

It turns out it's MAN!
Hair Elf

Bob Morales posted:

Come on dude, Google for 30 seconds

http://www.mediacollege.com/internet/javascript/page/scroll.html

Yeah that doesn't appear to work, and I wasn't lying when I said I knew nothing about javascript, I'm applying my knowledge I grasped from my programming1 class from 7 years back which was in C++.

SynVisions
Jun 29, 2003

Is there a way to disable the check on permissions of a private key file for SSH? We're trying to setup a script which ssh's into an appliance as a user account that has readonly rights to gather some data. Ideally we would like any user to be able to run this script to view the data without them all having their own user account and key on the appliance. This is ultimately complicated by the fact that due to limitations of the appliance we cannot specify keys for individual users and authenticate their passwords against LDAP at the same time.

The problem we're hitting is that giving read access to the private key file to others causes ssh to reject the key.

In googling around I see something about StrictModes, but it doesn't seem to take on command line execution (-o flag) so it's not helpful for us.

Any ideas?

edit: Guess I'll just have the key in the script and write it out to /tmp...

SynVisions fucked around with this message at 20:24 on Dec 18, 2009

WildGunman
Feb 11, 2005
Fathering the Anti-Christ since 1927
This is a somewhat broad question, but it specifically applies to a Linux box I have, so I figured I'd ask it here.

How important is it to have a strong password for your SSH. The current password is not easily guessable, but it is short. Most of the ports on the computer are open, and I primarily use it to house a database and access it through ODBC across the internet with a dynamic DNS. In other words, it's not housing a bulletin board with thousands of users so it's visibility is low, but it does have it's own domain.

How real is the threat of someone stumbling across the IP and then using a computer algorithm to find the password via brute force?

SynVisions
Jun 29, 2003

WildGunman posted:

This is a somewhat broad question, but it specifically applies to a Linux box I have, so I figured I'd ask it here.

How important is it to have a strong password for your SSH. The current password is not easily guessable, but it is short. Most of the ports on the computer are open, and I primarily use it to house a database and access it through ODBC across the internet with a dynamic DNS. In other words, it's not housing a bulletin board with thousands of users so it's visibility is low, but it does have it's own domain.

How real is the threat of someone stumbling across the IP and then using a computer algorithm to find the password via brute force?

The threat is very real. After your server has been up for a while you will find that your logs are being inundated with brute force attempts. You will definitely want to have a solid SSH password just to eliminate the brute force risk.

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.
If you have SSH open to the Internet, it's not a bad idea to change the port, either. It won't stop anyone deliberately trying to find their way into your box, but it will clear up about 99.9% of the random bruteforce attempts from your logs.

bitprophet
Jul 22, 2004
Taco Defender

SynVisions posted:

The threat is very real. After your server has been up for a while you will find that your logs are being inundated with brute force attempts. You will definitely want to have a solid SSH password just to eliminate the brute force risk.

QFT. This is one of those things where 5-10 years ago it wasn't as big a deal, but as networks have become saturated with scans from compromised machines (thanks, Microsoft. thanks, lovely Unix sysadmins.) it's a very big threat at this point.

To answer your own question:

SynVisions posted:

In googling around I see something about StrictModes, but it doesn't seem to take on command line execution (-o flag) so it's not helpful for us.

How much did you read? StrictModes appears to be an sshd option, not an option for the client software (ssh), so you'll need to set it in /etc/ssh/sshd_config (or similar) and reload your SSH daemon, on the server side.

SynVisions
Jun 29, 2003

bitprophet posted:

How much did you read? StrictModes appears to be an sshd option, not an option for the client software (ssh), so you'll need to set it in /etc/ssh/sshd_config (or similar) and reload your SSH daemon, on the server side.

Ahhh interesting, so the option for whether the connecting SSH client should be checking perms on its local files is a setting on the destination server? I completely glossed over the fact that it was a server side option.

Regardless it's not helpful for us because we don't have that granular level of control over the sshd_config on the appliance. Also oddly enough when I did make the change on another server and restarted the daemon it still threw an error on connection about perms of the identity file. It's not really important though at this point.

I'm fine with encapsulating the keyfile in the script for this problem.

nbv4
Aug 21, 2002

by Duchess Gummybuns
on my local machine, I'm running Ubuntu Karmic, and the version of python installed is 2.6.4:

code:
chris@chris-comp ~ $ python
Python 2.6.4 (r264:75706, Dec  7 2009, 18:43:55) 
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
But on my VM where all my sites are hosted, I'm running Karmin as well (the server edition), and my python version is different:

code:
chris@linode ~ $ python
Python 2.6.4rc2 (r264rc2:75497, Oct 20 2009, 02:55:11) 
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
I've done a "sudo apt-get update; sudo-apt-get upgrade" but it doesn't seem to make a difference. Why is this?

covener
Jan 10, 2004

You know, for kids!

nbv4 posted:

Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55)
Python 2.6.4rc2 (r264rc2:75497, Oct 20 2009, 02:55:11)

which python and "apt-cache policy python" on both might give a hint

bitprophet
Jul 22, 2004
Taco Defender

SynVisions posted:

Ahhh interesting, so the option for whether the connecting SSH client should be checking perms on its local files is a setting on the destination server? I completely glossed over the fact that it was a server side option.

Regardless it's not helpful for us because we don't have that granular level of control over the sshd_config on the appliance. Also oddly enough when I did make the change on another server and restarted the daemon it still threw an error on connection about perms of the identity file. It's not really important though at this point.

I'm fine with encapsulating the keyfile in the script for this problem.

Hrm, I thought you were talking about the remote key file, which is what is usually implicated in the "bad permissions == not gonna allow key-based auth" problem. The local key file's permissions, AFAIK, should not matter, though I haven't tested this.

Regardless, if you're using a hardware app instead of a full server, then yea, your options are pretty limited :(

30 TO 50 FERAL HOG
Mar 2, 2005



I want to mount a device twice (once as normal once as read only). What is the best way to do this? I was thinking making a symlink to /dev/md0 (currently everything is using UDID) or could I simply mount by device and once by UDID?

Jo
Jan 24, 2005

:allears:
Soiled Meat

BiohazrD posted:

I want to mount a device twice (once as normal once as read only). What is the best way to do this? I was thinking making a symlink to /dev/md0 (currently everything is using UDID) or could I simply mount by device and once by UDID?

mount --bind might be able to help you here. I'm not sure if you can pass -o ro the second time, but it might work.

Example:
sudo mount /dev/mapper/truecrypt1 /mnt/crypt0 -o umask=0
sudo mount --bind /mnt/crypt0 /home/ftp/friends -o ro

EDIT: -o ro, not readonly.

Jo fucked around with this message at 20:05 on Dec 19, 2009

30 TO 50 FERAL HOG
Mar 2, 2005



http://lwn.net/Articles/281157/

It is supposed to work, but it fails silently and the directory that is supposed to be read only isn't.

code:
biohazrd@BiohazrDMC:~$ sudo mount --bind -o ro /media/raid/ /media/raidRO/
biohazrd@BiohazrDMC:~$ cd /media/raidRO/
biohazrd@BiohazrDMC:/media/raidRO$ ls
Anime  Books               fstab  Movies  TV
Apps   directory_list.txt  Games  Music   Unsorted
biohazrd@BiohazrDMC:/media/raidRO$ touch newfile
biohazrd@BiohazrDMC:/media/raidRO$ ls
Anime  Books               fstab  Movies  newfile  Unsorted
Apps   directory_list.txt  Games  Music   TV
biohazrd@BiohazrDMC:/media/raidRO$

30 TO 50 FERAL HOG fucked around with this message at 20:25 on Dec 19, 2009

Jo
Jan 24, 2005

:allears:
Soiled Meat
:(

---

I'm having problems mounting an mp3 player as a block device. gPhoto2 keeps grabbing it and doing its multimedia LET ME HELP YOU bullshit. I just want to mount a mass storage device.

dmesg | tail posted:

1785204.988030] usb 2-4: new high speed USB device using ehci_hcd and address 21
[1785205.344239] hub 2-0:1.0: unable to enumerate USB device on port 4
[1785205.588016] usb 2-4: new high speed USB device using ehci_hcd and address 22
[1785205.734222] usb 2-4: configuration #1 chosen from 1 choice
[1785205.748898] scsi11 : SCSI emulation for USB Mass Storage devices
[1785205.749078] usb-storage: device found at 22
[1785205.749080] usb-storage: waiting for device to settle before scanning

lsusb posted:

Bus 002 Device 022: ID 0781:7432 SanDisk Corp. Sansa Clip (mtp)

There doesn't appear to be an entry in /dev/sd*.

30 TO 50 FERAL HOG
Mar 2, 2005



code:
[1785205.748898] scsi11 : SCSI emulation for USB Mass Storage devices
Try to mount /dev/scsi11

Jo
Jan 24, 2005

:allears:
Soiled Meat

BiohazrD posted:

code:
[1785205.748898] scsi11 : SCSI emulation for USB Mass Storage devices
Try to mount /dev/scsi11

Ah, I should have mentioned that no /dev/scsi* devices appear, either.

30 TO 50 FERAL HOG
Mar 2, 2005



What's the output of "fdisk -l"

Jo
Jan 24, 2005

:allears:
Soiled Meat
Hmm. Interesting. It's not showing up in there, either.

sudo fdisk -l posted:

jo@Euclid:~$ fdisk -l
jo@Euclid:~$ sudo fdisk -l
[sudo] password for jo:

Disk /dev/sda: 750.1 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00065343

Device Boot Start End Blocks Id System
/dev/sda1 * 1 52272 419873816 7 HPFS/NTFS
/dev/sda2 52273 90690 308592585 83 Linux
/dev/sda3 90691 91201 4104607+ 82 Linux swap / Solaris

EDIT: I disabled automount and the gPhoto2 bullshit, the unplugged and replugged. No go.

30 TO 50 FERAL HOG
Mar 2, 2005



BiohazrD posted:

http://lwn.net/Articles/281157/

It is supposed to work, but it fails silently and the directory that is supposed to be read only isn't.

code:
biohazrd@BiohazrDMC:~$ sudo mount --bind -o ro /media/raid/ /media/raidRO/
biohazrd@BiohazrDMC:~$ cd /media/raidRO/
biohazrd@BiohazrDMC:/media/raidRO$ ls
Anime  Books               fstab  Movies  TV
Apps   directory_list.txt  Games  Music   Unsorted
biohazrd@BiohazrDMC:/media/raidRO$ touch newfile
biohazrd@BiohazrDMC:/media/raidRO$ ls
Anime  Books               fstab  Movies  newfile  Unsorted
Apps   directory_list.txt  Games  Music   TV
biohazrd@BiohazrDMC:/media/raidRO$

code:
biohazrd@BiohazrDMC:/media$ sudo umount /media/raidRO
biohazrd@BiohazrDMC:/media$ sudo mount --bind /media/raid/ /media/raidRO/
biohazrd@BiohazrDMC:/media$ sudo mount -o remount,ro /media/raidRO/
biohazrd@BiohazrDMC:/media$ cd /media/raidRO/
biohazrd@BiohazrDMC:/media/raidRO$ ls
Anime  Books               fstab  Movies  TV
Apps   directory_list.txt  Games  Music   Unsorted
biohazrd@BiohazrDMC:/media/raidRO$ touch newfile
touch: cannot touch `newfile': Read-only file system
biohazrd@BiohazrDMC:/media/raidRO$
:haw:

Now, how do I make this happen automatically? I can use bind as a mount type in fstab, but I can't execute the remount.

30 TO 50 FERAL HOG fucked around with this message at 20:53 on Dec 19, 2009

30 TO 50 FERAL HOG
Mar 2, 2005



Repost dmesg after disabling that stuff and replugging the device.

Jo
Jan 24, 2005

:allears:
Soiled Meat
Oh good you got your stuff working. :toot:

---

New dmesg data: posted:

[1785950.668026] usb 2-4: new high speed USB device using ehci_hcd and address 24
[1785950.814253] usb 2-4: configuration #1 chosen from 1 choice
[1785950.830101] scsi12 : SCSI emulation for USB Mass Storage devices
[1785950.830363] usb-storage: device found at 24
[1785950.830366] usb-storage: waiting for device to settle before scanning

Hmm. That waiting for device to settle message is a bit curious.

EDIT: Found a potential solution on a Linux forum. Will report on failure.

Solution: Edit /usr/share/hal/fdi/preprobe/10osvendor/20-libgphoto2.fdi and hose every reference to SanDisk. Unplug, replug.

EDIT: :haw: \/\/\/

Jo fucked around with this message at 21:03 on Dec 19, 2009

30 TO 50 FERAL HOG
Mar 2, 2005



It seems to have something to do with your Sansa player. There's actually quite a bit of info about it from the quick Googling I did.

https://bugs.launchpad.net/ubuntu/+source/libgphoto2/+bug/355998

What distro are you using? There are two fixes that you could try, but one is Ubuntu only.

waffle iron
Jan 16, 2004
If it is anything like the Sansa Fuse, you have to go into the Settings and change the USB mode from Auto (or MTP) to MSC (Mass Storage Device mode). Auto mode tricks you into thinking it is an OS problem because it waits for an MTP transfer and if none comes, it switches to MSC.

And beware, if you have any files transfered in MTP mode, they won't show up on the MSC FAT filesystem and the file system size will be smaller than expected.

Edit: http://forums.sandisk.com/sansa/board/message?board.id=clip&thread.id=570

waffle iron fucked around with this message at 04:17 on Dec 20, 2009

Riso
Oct 11, 2008

by merry exmarx
I build myself a custom 2.6.32.2 kernel for my notebook in linux mint 8 and have the following problem: whenever I try to wake the notebook it just freezes and I have to kill it. Logs tell me I get a "low memory corruption error".
Hibernate works fine. Any ideas?

deong
Jun 13, 2001

I'll see you in heck!
I'm wanting to reinstall my system from scratch, and was wondering if I should go x64 or stick with x32? I'd be using Ubuntu. I have not made a clean install since like 7.04 or longer. Is there much advantage of one over the other? Are there still tons of flash issues in x64? I use this machine for mainly surfing and video.

edit: I'm currently on a Live x64 disk. Everything appears to be working hardware wise.

Absinthe
Jan 9, 2004

deong posted:

I'm wanting to reinstall my system from scratch, and was wondering if I should go x64 or stick with x32? I'd be using Ubuntu. I have not made a clean install since like 7.04 or longer. Is there much advantage of one over the other? Are there still tons of flash issues in x64? I use this machine for mainly surfing and video.

edit: I'm currently on a Live x64 disk. Everything appears to be working hardware wise.

If you're not planning on playing games or something and you just do the typical Internet/Music/Movies/Word Processing thing than I doubt you have much to worry about. Flash 64 bit is available from Adobe Labs and works very well for most people.

Edit: I notice subtle differences using 64-bit. Faster decompression of compressed files. More responsive media players. Much faster video compression. Etc.

Absinthe fucked around with this message at 21:59 on Dec 20, 2009

FISHMANPET
Mar 3, 2007

Sweet 'N Sour
Can't
Melt
Steel Beams
There's an ubuntu package for flash, which makes it mind numbingly simple. I think it's flash-nonefree or something. All it does is wget the Adobe labs thing, but it will get a new one automatically when/if a new version is released.

deong
Jun 13, 2001

I'll see you in heck!
Awesome.
I've got an xbox for games heh. 64bit, here I come!

epswing
Nov 4, 2003

Soiled Meat
Which should go first, rm or find, and why?

code:
rm -rf `find . -type d -name .svn`
code:
find . -depth -type d -name "\.svn" -exec rm -rf {} \;

nbv4
Aug 21, 2002

by Duchess Gummybuns
If you want to execute a big sql file into postgres, you use this command:

code:
psql ddname < path/to/file.sql
but how would you do it if your sql file is bz2'd?

code:
bunzip2 path/to/file.sql.bz2 | psql dbname
I'm thinking the above should work, but it doesn't seem to...

SynVisions
Jun 29, 2003

nbv4 posted:

If you want to execute a big sql file into postgres, you use this command:

code:
psql ddname < path/to/file.sql
but how would you do it if your sql file is bz2'd?

code:
bunzip2 path/to/file.sql.bz2 | psql dbname
I'm thinking the above should work, but it doesn't seem to...

By default bunzip2 is just going to decompress the file and return 0 on success. This should probably work for you instead:

code:
bunzip2 -c path/to/file.sql.bz2 | psql dbname
Which will force it to output the decompressed file to stdout, which you can then pipe to psql.

nbv4
Aug 21, 2002

by Duchess Gummybuns

SynVisions posted:

By default bunzip2 is just going to decompress the file and return 0 on success. This should probably work for you instead:

code:
bunzip2 -c path/to/file.sql.bz2 | psql dbname
Which will force it to output the decompressed file to stdout, which you can then pipe to psql.

sweet that worked, thanks

waffle iron
Jan 16, 2004
I use zcat. It's a script that invokes any of the bzip or gzip programs.

Adbot
ADBOT LOVES YOU

Saukkis
May 16, 2003

Unless I'm on the inside curve pointing straight at oncoming traffic the high beams stay on and I laugh at your puny protest flashes.
I am Most Important Man. Most Important Man in the World.

epswing posted:

Which should go first, rm or find, and why?

code:
rm -rf `find . -type d -name .svn`
code:
find . -depth -type d -name "\.svn" -exec rm -rf {} \;
The first one runs only one 'rm-command', but if there are too many directories it may exceed the bash parameter limit and the command won't work. It will probably also give lots of errors when 'rm' tries to remove subfolders that were already removed. The second one will run separate 'rm' for every directory, so there won't be problem with the parameter limit. I believe neither of those can handle spaces, the exec can be fixed with rm -rf '{}' \;.

I think usually it's considered most correct to use xargs, but it may run into to the same problem where 'rm' tries to remove folders that were already removed.
code:
find . -depth -type d -name "\.svn" -print0 | xargs -0 rm -rf

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