Re: disaster recovery - did I do the right thing?

2007-05-08 Thread Bernd Trippel
Martin Tournoij typed on 06/05/07 05:23:
 On Sat 05 May 2007 18:05, Garrett Cooper wrote:
 Martin Tournoij wrote:
 On Sat 05 May 2007 17:05, Ray wrote:
 Hello all,
 I did something stupid the other day (sleep deprivation combined with a 
 clever hack were the main reasons), and I'm just curious if I did 
 the right thing afterwards.

 The mistake:
 /usr/local/# rm -f *
 note that root was running bash as a shell at the time, found in 
 /usr/local/bin or something.

 What I did was to start over, reinstall from scratch.
 my question, was there an easier way?
 thanks,
 Ray 
 You can use pkg_info -ga to check for missing files in your packages.
 For (t)csh:
 alias rm rm -i

 For (ba)sh:
 alias rm=rm -i

 Now that you've learned :).

 Martin's suggestion is good though -- would have done that considering that 
 all that lived in /usr/local were ports.

 -Garrett
 
 The problem with this is that it will ask confirmation for every file it
 deleted.
 Which is gets pretty annoying after a while, also, if you delete a
 directory containing a 100 files, you will have to press 'y' a 100
 times.
 This will probably lead to the habit of using 'rm -f', and/or simply
 pressing y all the time without actually looking at the confirmation
 message.
 In any case, it's not likely to prevent any such accidents.
 
For the sake of it: You could use rm -I:
quoting the rm man page:
-I  Request confirmation once if more than three files are being
removed or if a directory is being recursively removed.
This is a far less intrusive option than -i yet provides almost
the same level of protection against mistakes.

Output looks like this:
# rm -fI *
remove 10 files?

Would even be better if it would list e.g. 2 or 3 files.

 A better solution would be to write a script that would move files
 instead of deleting them.
 You should name this script to something else than rm, when you're
 working with a new or foreign system, you will expect rm to move
 files, instead of deleting them ... and we can all see another
 disaster coming there...

true, sometimes fingers have a memory of their own ;)
 
 Another hint would be the 'rmstar' option in tcsh, when set, tcsh will
 ask confirmation before executing 'rm *'.
 
 Note that aliasing 'cp' and 'mv' to 'cp -i' and 'mv -i' is an
 *extremely* wise idea, in the past I have often accidentally overwritten
 files that should not have been overwritten, leading to various
 problems.
 

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Query file system type for yet-to-be mounted volumes?

2007-05-07 Thread Bernd Trippel
Modulok typed on 07/05/07 11:02:
 How does one determine the file system a disk uses, for disks that are
 not yet mounted? Example: You're handed a disk that has been sitting
 around in a closet for years, with no idea what it was used for. The
 department manager tells you to see what it contains.
 
 How do I mount it, if I don't already know what file system it uses?
 Is there a command to query this? Trial and error doesn't seem like
 the ideal solution.

You might get a clue using file:
eg:
# file -s /dev/da0s1
/dev/da0s1: x86 boot sector, code offset 0x3c, OEM-ID MSDOS5.0,
sectors/cluster 32, root entries 512, Media descriptor 0xf8, sectors/FAT
250, heads 255, hidden sectors 32, sectors 2044383 (volumes  32 MB) ,
serial number 0x64650d9b, unlabeled, FAT (16 bit)

see man file

As far as I am aware parted or gparted (partition-editor running on
Linux) is not in ports, but there is a 50MB-live-cd availabe:
http://gparted.sourceforge.net/livecd.php but you might want to check
the features first.

 
 -Modulok-
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to
 [EMAIL PROTECTED]
 

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: deleting file '--preserve-permissions'

2007-04-01 Thread Bernd Trippel
The fingers of Garrett Cooper typed on 01/04/07 01:00:
 Garrett Cooper wrote:
 Derek Ragona wrote:
 try:
 rm -i *

 only answer y to the one you want deleted.

 -Derek


 At 02:36 PM 3/31/2007, [EMAIL PROTECTED] wrote:
 I've made mistake with tar. Something like

 tar cvfz --preserve-permissions home.tgz *

 or

 tar cvfz --preserve-permissions * home.tgz

 As result I have a file with name '--preserve-permissions'.
 It seems that it's not easy to delete this file.

 rm '--preserve-permissions'

 does not give the desired result.
 What should I do :-)
 rm -- '--perserve-permissions'. -- tells getopt to stop searching and
 the single quotes are a double bonus because it doesn't interpret the
 string contents beforehand, but instead passes it on as a straight
 string.

 Try: rm --perserve-permissions and rm '--perserve-permissions', in
 that order to just see what happens ;)..

 -Garrett
 Haha. Forgot that the single quotes version won't work by itself. It's
 basically for cases when there are shell sensitive characters inside a
 string, when compared to the double quotes. The first solution with --
 will work though, guaranteed :).
 
 -Garrett
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to
 [EMAIL PROTECTED]
 

You should always be able to delete files per inode, which is quite
handy with files containing special characters.

ls -i *
2324367 foo
find . -inum 2324367 -exec rm {} \;

Saves me a lot of hassle.



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: How to use vsftpd with wirtual users without LinuxPAM ?

2007-03-22 Thread Bernd Trippel

Quoting Vincent Bolinard [EMAIL PROTECTED]:


Hello,

I'd like to know how can I set up virtual users without pam_userdb.so
(which is not included in OpenPAM).

vsftpd needs pam_userdb.so to authenticate against the db Berkeley database.
What else can I use ?

I don't want to use MySQL because there won't be a lot of virtual 
users ( 50).


Thank you for your help.


Basically you can use any authentication method provided by OpenPam. 
For Users 

50  pam_pwdfile.so should fit your needs, esp. if you are familiar with
htpasswd.

Check the list-archive:
http://lists.freebsd.org/pipermail/freebsd-questions/2006-April/117915.html



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Cron [EMAIL PROTECTED] /usr/libexec/save-entropy

2006-09-22 Thread Bernd Trippel

Quoting Martin McCormick [EMAIL PROTECTED]:


I must have dome something wrong setting up a FreeBSD5.4
system, but I haven't a clue as to what.

The script is called save-entropy, a great idea, but it
acts as if lots of the configuration it needs is missing.  I do
have ipfw running and it got all the rules I put in to it via a
rule-setting script called in rc.conf.local but the message that
cron generates every eleven minutes shows that something is very
unhappy.

For now, I simply commented out the save-entropy run for
a bit of peace and quiet, but the entropy is now not being
updated which is not a good thing.

What do I need to look at to fix this properly?

Thank you.

Martin McCormick WB5AGZ  Stillwater, OK
Systems Engineer
OSU Information Technology Department Network Operations Group

--- Forwarded Message


Date:Fri, 22 Sep 2006 08:55:00 CDT

From:[EMAIL PROTECTED] (Cron Daemon)
Subject: Cron [EMAIL PROTECTED] /usr/libexec/save-entropy


ipfw: not found

That repeats 15 more times.


--- End of Forwarded Message




Seems you have a line containing only ipfw in your rc.conf.
Comment it out or remove it. save-entropy relies on files specified in 
rc.conf.



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: vsftpd pam problem

2006-04-02 Thread Bernd Trippel

Quoting Terry [EMAIL PROTECTED]:


Hi going by the docs for virtual users i have got to this file vsftpd.pam

auth required /lib/security/pam_userdb.so db=/etc/vsftpd_login
account required /lib/security/pam_userdb.so db=/etc/vsftpd_login

From google i gather pam_userdb.so isn't part of OpenPAM which is 
what FreeBSD uses. So how do Freebsd users get round it or am i 
missing some thing really silly.



In my understanding this is correct. There's no pam_userdb.so available for
FreeBSD.
You could use pam_pwdfile.so, which is in the ports-collection. Users are
added/changed e.g. through htpasswd. Works well if you have not a lot of
accounts.

a simple vsftpd.pam could look like this:
auth   required/usr/local/lib/pam_pwdfile.so pwdfile /etc/vsftpd_login
account  required/usr/lib/pam_permit.so



Thanks





___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]