LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 07-29-2011, 06:15 AM   #1
theblackpig
LQ Newbie
 
Registered: Jul 2011
Posts: 2

Rep: Reputation: Disabled
Thumbs up Newbie needs help to change folder/file permissions


I've previously run Mandriva OS but have now changed to Suse Enterprise Desktop.I imported files and folders from My backup hard disc but they are all "locked" I tried going into properties but I'm told as I'm not the owner I can't change anything.
How do I change the permissions?
IN SIMPLE STEP BY STEP INSTRUCTIONS PLEASE as I'm a bit of an ignoramus

Last edited by theblackpig; 07-29-2011 at 01:58 PM. Reason: SOLVED
 
Old 07-29-2011, 07:13 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
You'll have to do that as root (either logged in as root, use su - or using sudo) in a "terminal" window.

You'll need to be careful depending upon where the directories and files were "imported" to; i.e., just exactly what did you import? Your own directories and files? System directories and files? Your own stuff you can do as below but, if you somehow imported system directories and files, you don't want to fiddle with them (system directories would be such as /etc, /usr/bin, /lib and the like).

So, let's assume that what you imported was your /home/username directory from the Mandriva system? Maybe some data directories and files? Stuff that's not system stuff?

Change directory to wherever your directories/files were put and execute
Code:
ls -al
to show you the names and permission masks; directories should look like
Code:
drwxr-xr-x  2 owner group      4096 Jan 13  2010 test/
and files should look like
Code:
-rw-r--r--  1 owner group      1484 Oct 26  2009 testing.doc
where "owner" is the name (or, possibly, a number, see below) of "who" owns the file or directory and "group" is the name (or number) of the group. Note that the number immediately to the left of the date is the size of the directory or file; ignore it.

If either the owner or group is numeric that would be because on your new system there is no owner or group with those identification numbers -- not to worry.

So, let's say that these recovered files don't have the default mask values (drwxr-xr-x for directories and rw-r--r-- for files) and you'd like to correct them to a reasonable default.

If they do have the default mask values, don't do this.

Still logged in as root (or using sudo)
Code:
cd to the directory where all the files and directories are -- do not do this in the root directory!
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
That will fix the masks (note: that will set all files to read-write, read, read -- if you have any files that you want executable, you'll need to manually change them with
Code:
chmod 755 filename
but don't do that now.

Now, let's assume that you want the directories and files to be owned by you; i.e., your login, and your default group (most likely "users"):
Code:
chown -R your_login:users *
That should do it.

Before you start, you might want to glance at the manual pages for find, chmod and chown to get a feel for what they do. Also, before you start, logged in as "you," and enter
Code:
groups
You ought to see something similar to
Code:
users lp floppy dialout audio video cdrom plugdev power usbfs netdev scanner vboxusers cvs
(Yours will probably vary).

Your default group is the first one on the left, in this case users. That's the one you use above.

Hope this helps some.

Last edited by tronayne; 07-29-2011 at 07:55 AM.
 
1 members found this post helpful.
Old 07-29-2011, 01:57 PM   #3
theblackpig
LQ Newbie
 
Registered: Jul 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hi tronayne, didn't understand a lot of what you posted BUT I tried this "chown -R your_login:users * "
and it worked a treat, many thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linpus Lite - Change File/Folder Permissions osaddict Linux - Newbie 25 09-05-2010 03:01 PM
how to change folder permissions in fc-6 chryslercirrus99 Fedora 3 06-07-2007 06:32 PM
How can I change the access permissions of a file or folder? royeo Linux - Newbie 1 07-25-2006 03:36 PM
Change folder permissions eggoz Linux - Newbie 2 03-17-2003 01:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 10:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration