Professional Web Applications Themes

two question about linux - Linux Setup, Configuration & Administration

1) using the "rm" command i can delete files and directory but if i make a mistake, how can i undo the command to have my deleted files back? How about the same "undelete" dos command in linux? 2) i installed a little distro on an hold pc. to install new packages it's necessary to insert the install disk, but with this i can mount my hda2 partition without limitations because the diskette use a root user without a password. This mean that doing the boot from the inst diskette i can execute this command: mount /dev/hda2 /mnt -t ext2 ...

  1. #1

    Default two question about linux

    1) using the "rm" command i can delete files and directory

    but if i make a mistake, how can i undo the command to have my deleted files
    back?
    How about the same "undelete" dos command in linux?

    2) i installed a little distro on an hold pc.

    to install new packages it's necessary to insert the install disk, but with
    this i can mount my hda2 partition without limitations because the diskette
    use a root user without a password.
    This mean that doing the boot from the inst diskette i can execute this
    command:

    mount /dev/hda2 /mnt -t ext2

    and i can view the /root dir as "root" from /mnt/root

    how can i forbid the "/" partition to whom is not the administrator of my
    pc?

    thank you!


    vittorio Guest

  2. #2

    Default Re: two question about linux

    "vittorio" <stortoarancilibero.it> writes:

    ]1) using the "rm" command i can delete files and directory

    ]but if i make a mistake, how can i undo the command to have my deleted files
    ]back?
    ]How about the same "undelete" dos command in linux?

    It does not exist. You cannot undo the command.
    What you could do is to set up a alias, like

    function rm () { cp $* /tmp; /bin/rm $* ;}
    which will first copy your file to the tmp directory and then remove it.
    ( a better procedure might simply be to do
    function rm () { mv $* /tmp ;}
    )

    However then there is the danger or completely filling /tmp with your
    junk.


    ]2) i installed a little distro on an hold pc.

    ]to install new packages it's necessary to insert the install disk, but with
    ]this i can mount my hda2 partition without limitations because the diskette
    ]use a root user without a password.
    ]This mean that doing the boot from the inst diskette i can execute this
    ]command:

    ]mount /dev/hda2 /mnt -t ext2

    ]and i can view the /root dir as "root" from /mnt/root

    ]how can i forbid the "/" partition to whom is not the administrator of my
    ]pc?

    You cannot. The / partition is crucial for everyone. They must be able
    to see it, in order to do anything.
    That is not true of /root. However if you allow anyone to put in a
    rescue disk, then your machine is open. You could password protect the
    booting in the bios with a bios password. But with physical access to
    your system, that can also be overcome.
    If someone has physical access to your system then that system is open
    to them, unless you encrypt your drives.


    Bill Unruh Guest

  3. #3

    Default Re: two question about linux

    On Mon, 15 Sep 2003 20:54:43 GMT, vittorio <stortoarancilibero.it> wrote:
    >
    >
    > 1) using the "rm" command i can delete files and directory
    >
    > but if i make a mistake, how can i undo the command to have my deleted files
    > back?
    > How about the same "undelete" dos command in linux?
    >
    You can alias rm to rm -i, and then it will prompt you before completion.


    You can create a "trashbin" where files are sent instead of being deleted.

    create a directory called .tb and put this in your .bashrc

    tb ()

    {
    mv "$" ~/.tb ;

    }

    then add

    alias rm='tb'

    and enter

    $ source .bashrc


    > 2) i installed a little distro on an hold pc.
    >
    > to install new packages it's necessary to insert the install disk, but with
    > this i can mount my hda2 partition without limitations because the diskette
    > use a root user without a password.
    > This mean that doing the boot from the inst diskette i can execute this
    > command:
    >
    > mount /dev/hda2 /mnt -t ext2
    >
    > and i can view the /root dir as "root" from /mnt/root
    >
    > how can i forbid the "/" partition to whom is not the administrator of my
    > pc?
    >
    > thank you!
    >
    >

    Don't know,


    AC


    --

    take control of your mailbox ----- elrav1 ----- [url]http://tinyurl.com/l55a[/url]
    spammers hate this program because they can't beat it

    Alan Connor Guest

  4. #4

    Default Re: two question about linux

    vittorio wrote:
    > 1) using the "rm" command i can delete files and directory
    >
    > but if i make a mistake, how can i undo the command to have my deleted files
    > back?
    Restore the file from your last backup.
    Otherwise, you've just lost the file.
    > How about the same "undelete" dos command in linux?
    Nope.
    > 2) i installed a little distro on an hold pc.
    >
    > to install new packages it's necessary to insert the install disk, but with
    > this i can mount my hda2 partition without limitations because the diskette
    > use a root user without a password.
    > This mean that doing the boot from the inst diskette i can execute this
    > command:
    >
    > mount /dev/hda2 /mnt -t ext2
    >
    > and i can view the /root dir as "root" from /mnt/root
    >
    > how can i forbid the "/" partition to whom is not the administrator of my
    > pc?
    Don't permit installations based on an install disk boot.
    It's unnecessary, and (as you can see) a security risk.

    --

    Lew Pitcher, IT Consultant, Application Architecture
    Enterprise Technology Solutions, TD Bank Financial Group

    (Opinions expressed here are my own, not my employer's)

    Lew Pitcher Guest

  5. #5

    Default Re: two question about linux

    vittorio wrote:
    > 1) using the "rm" command i can delete files and directory
    >
    > but if i make a mistake, how can i undo the command to have my deleted files
    > back?
    > How about the same "undelete" dos command in linux?
    >
    <snip>

    Has anyone tried this?

    'unrm'

    [url]http://freshmeat.net/projects/unrm/?topic_id=866[/url]

    --

    Mauriat
    ----------------------------
    Remove 'NOSPAM' to email me.

    Mauriat Guest

  6. #6

    Default Re: two question about linux

    >> Don't permit installations based on an install disk boot.
    > It's unnecessary, and (as you can see) a security risk.
    how can i do this?

    let me know if there is some mini/how-to about this thank's



    vittorio Guest

  7. #7

    Default Re: two question about linux

    vittorio wrote:
    >>>Don't permit installations based on an install disk boot.
    >>
    >>It's unnecessary, and (as you can see) a security risk.
    >
    >
    > how can i do this?
    Either physically or logically.

    The "logical" approach would be to disable the "boot from floppy" in your BIOS
    (perhaps by setting "BOOT ORDER C:,A:")

    The "physical" approach would be to disable or remove the floppy disk drive.

    In either case, you have to remove the physical capability of someone booting
    off a floppy or other unauthorized media.


    --
    Lew Pitcher

    Master Codewright and JOAT-in-training
    Registered Linux User #112576 ([url]http://counter.li.org/[/url])
    Slackware - Because I know what I'm doing.

    Lew Pitcher Guest

  8. #8

    Default Re: two question about linux

    Lew Pitcher wrote:
    > vittorio wrote:
    >
    >>>> Don't permit installations based on an install disk boot.
    >>>
    >>>
    >>> It's unnecessary, and (as you can see) a security risk.
    >>
    >>
    >>
    >> how can i do this?
    >
    >
    > Either physically or logically.
    >
    > The "logical" approach would be to disable the "boot from floppy" in
    > your BIOS (perhaps by setting "BOOT ORDER C:,A:")
    Logical can often be beaten by interrupting the reboot to fail 3 times
    in a row, which on many mothereboards resets the BIOS to its default
    values. Its a *nasty* trick, and a good reason to avoid reprogramming
    your BIOS to get cutesy behaviors.

    Nico Kadel-Garcia Guest

Similar Threads

  1. V8 FP3 - Linux / question on missing JDK
    By Jean-Marc Blaise in forum IBM DB2
    Replies: 2
    Last Post: September 8th, 05:59 AM
  2. Question on which Linux Binaries to d/l for Linux Redhat 7.0 ?
    By K T in forum Linux Setup, Configuration & Administration
    Replies: 2
    Last Post: August 22nd, 05:16 PM
  3. Linux Backup Question
    By Crusher in forum Sun Solaris
    Replies: 1
    Last Post: July 31st, 12:30 PM
  4. question re. iTunes library on YD Linux
    By Chris Scott in forum Mac Applications & Software
    Replies: 0
    Last Post: July 9th, 02:38 PM
  5. Oracle 9i for Linux Cluster Question
    By Howard J. Rogers in forum Oracle Server
    Replies: 1
    Last Post: December 14th, 09:45 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139