noob chown -R root / and now everything is f'd... can't login, etc

Discussion in 'Software' started by jibble, Sep 20, 2011.

  1. jibble

    jibble Private E-2

    So, a few months ago i set up an amazon free tier ec2 instance as a way to learn/something to play with. Well, i'm learning... THE HARD WAY.

    I was trying to change permissions on a directory (by means of google, again, i'm learning) and read something about chown and, because nothing special is on my instance i wanted full access to everything as ec2-user. So i did this,

    sudo chown -R root / (or something of the like, i think i should have used my username 'ec2-user' instead of root :/)

    i had already set a few things up successfully, ftp being one of them, which after typing that immediately kicked me off... Then i could not sudo and got "sudo: must be setuid root" So, i thought i would tackle it later, closed out putty and now i can't log back in... HELP!

    Did i completely remove ec2-user? Is there anything i can do? or is a re-install my only hope?

    Again, it's really not the end of the world, but a lesson well learned ;)

    any help would be greatly appreciated as half of what i've done i likely won't remember how i did it!

    Thanks!
     
  2. BoredOutOfMyMind

    BoredOutOfMyMind Picabo, ICU

    Which Linux distro are you using and version?

    Sounds like you are an Ubuntu user.

    System > Administration > Users and Groups

    Should show if you have an ec2-user listed.
     
  3. hawklord

    hawklord Master Sergeant

    i believe this is cloud on demand and hosted by amazon,

    i don't know whether you can change permissions on a system that you only 'rent',

    maybe its easier (and cheaper) to run a virtual machine for your experiments
     
  4. jibble

    jibble Private E-2

    this is an amazon free tier which works great for trying stuff out.

    So... i rebuilt it (which took all of about 30 mins) and i'm running into the same permissions issue. With the amazon build im using i have to set everything up as ec2-user... now the default dir for that is /home. What i'm trying to do is give ec2-user full access to the /var or /var/www directory.

    still experimenting with it, but any advice would be wonderful. I've googled and googled to only find very vague stuff (which is what i keep locking myself out with lol)

    ideas?
     
  5. BoredOutOfMyMind

    BoredOutOfMyMind Picabo, ICU


    What exactly are you wanting to use EC2 for?

    Documentation pages
     
  6. not_guilty

    not_guilty Private E-2

    Maybe I should not reply to this thread but I just cannot help myself.
    Have no clue what this Amazon thing is since I've never visited Amazon for anything in my life.

    If one wants to experiment, then use the Virtual Box as one of the poster mentioned below (or above depending of your Forum settings)

    We still don't now what Distro you are using.
    It is important, example on PCLinuxOS (Mandriva based) you are setting root password during install along with your own.
    On Ubuntu these days you only set up user password with the option of setting root password yourself on your own later on.
    Groups and users should be configured right after install and every time the new user pops up after installation of some new program/service.

    If you choose to set up root password make sure it is a complex password and write it down.
    Rule #1 You never give permission to your /home directory to nobody ever (don't confuse with the user name "nobody")
    Rule #2 Do not give/change permission to nobody to any directory.
    Example /var or /var/www as you wrote in the OP.
    And finally not in the /root directory
    Only if you know what you are doing and only if it was specified in the instructions of whatever you are trying to install.
    As this is a case while installing LAMP and wordpress. Wordpress needs a database located in /var/www...Then you do the "chow main" chowing/chmod thing to the database folder not to the whole /var/www directory!

    Good thing for you would be to learn permission abc's, especially numerical ones and know how they correspond to Read/Write/Execute and the sticky
    here is the link to Ubuntu permission basics link: Ubuntu Permission basics

    If you cannot log in as yourself or that new user that you have been setting up, try to log in as a root.
    If you are on Ubuntu and never set it up the root password use the sudo command and execute the Display Manager command with the path (note it is a handy thing to have installed Debian "xdm" Display Manager)

    Finally when you do change permission(s) then navigate to the specific directory open the terminal there and then change permission to the folder/file that you need to change permission to.
    Bottom line is that permissions are there for a reason to protect your computer coming from the outside and the inside of your computer and assure proper functioning.

    Googling for solutions can be a dangerous thing as there are a lot more people on the Internet who like to give advice than there are people who actually know what they are talking about.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds