LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-12-2011, 11:48 AM   #1
hitmen
Member
 
Registered: Jun 2011
Distribution: Kubuntu 10.04
Posts: 158

Rep: Reputation: Disabled
Cannot Modify Folder Created By Program And Not By Me


Basically I used photorec to rescue my photos.
However, the program created a locked folder and I cant change the photos inside.

sudo chmod +x [folder name] does not help since I the user did not create the folder.

Help!
 
Old 11-12-2011, 11:51 AM   #2
hitmen
Member
 
Registered: Jun 2011
Distribution: Kubuntu 10.04
Posts: 158

Original Poster
Rep: Reputation: Disabled
c@c-laptop:~/bash_folder/recup_dir.1$ chmod +x *.jpg
chmod: changing permissions of `f0000768.jpg': Operation not permitted
chmod: changing permissions of `f0002496.jpg': Operation not permitted
chmod: changing permissions of `f0004096.jpg': Operation not permitted
chmod: changing permissions of `f0005760.jpg': Operation not permitted
chmod: changing permissions of `f0007424.jpg': Operation not permitted



c@c-laptop:~/bash_folder/recup_dir.1$ ls -la
total 141540
drwxr-xr-x 2 root root 4096 2011-11-11 20:26 .
drwxr-xr-x 5 c c 4096 2011-11-11 22:49 ..
-rw-r--r-- 1 root root 869505 2011-11-11 20:17 f0000768.jpg
-rw-r--r-- 1 root root 816079 2011-11-11 20:17 f0002496.jpg
-rw-r--r-- 1 root root 841498 2011-11-11 20:17 f0004096.jpg
 
Old 11-12-2011, 11:55 AM   #3
manwichmakesameal
Member
 
Registered: Aug 2006
Distribution: Slackware
Posts: 804

Rep: Reputation: 109Reputation: 109
Have you tried chowning the file to you?

edit: P.S. Why are you trying to make a directory executable?
 
Old 11-12-2011, 11:59 AM   #4
hitmen
Member
 
Registered: Jun 2011
Distribution: Kubuntu 10.04
Posts: 158

Original Poster
Rep: Reputation: Disabled
I am trying to make the files executable. I made the folder executable by mistake.

How do you chown?

Also, what is my root password? I tried su but i dont know the passwd
 
Old 11-12-2011, 12:05 PM   #5
hitmen
Member
 
Registered: Jun 2011
Distribution: Kubuntu 10.04
Posts: 158

Original Poster
Rep: Reputation: Disabled
c@c-laptop:~/bash_folder/recup_dir.1$ chown c *.jpg
chown: changing ownership of `f0000768.jpg': Operation not permitted
chown: changing ownership of `f0002496.jpg': Operation not permitted
chown: changing ownership of `f0004096.jpg': Operation not permitted
chown: changing ownership of `f0005760.jpg': Operation not permitted
chown: changing ownership of `f0007424.jpg': Operation not permitted
chown: changing ownership of `f0007744.jpg': Operation not permitted
 
Old 11-12-2011, 12:34 PM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by hitmen View Post
Also, what is my root password? I tried su but i dont know the passwd
You are almost certainly going to need it. A list of pages about doing so here.
 
Old 11-12-2011, 12:42 PM   #7
tollingalong
Member
 
Registered: Nov 2011
Posts: 42

Rep: Reputation: Disabled
First do 'sudo bash' to become an elevated user.
Then when you do 'id' it should show say "uid=0(root) gid=0(root) groups=0(root)" or something to ensure you're a root user. That will allow you to chown c *.jpg. Just be sure to be in the directory with the jpg files .
 
Old 11-12-2011, 01:05 PM   #8
hitmen
Member
 
Registered: Jun 2011
Distribution: Kubuntu 10.04
Posts: 158

Original Poster
Rep: Reputation: Disabled
ok done. Now how do I go back in user mode?
 
Old 11-12-2011, 11:27 PM   #9
hitmen
Member
 
Registered: Jun 2011
Distribution: Kubuntu 10.04
Posts: 158

Original Poster
Rep: Reputation: Disabled
up. How do I go back to user mode, (other than restarting).

What is the diff between sudo bash and su?
 
Old 11-12-2011, 11:31 PM   #10
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 190Reputation: 190
Code:
exit
 
Old 12-19-2011, 11:16 AM   #11
hitmen
Member
 
Registered: Jun 2011
Distribution: Kubuntu 10.04
Posts: 158

Original Poster
Rep: Reputation: Disabled
What is the diff between sudo bash and su?
 
Old 12-19-2011, 11:23 AM   #12
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 242Reputation: 242Reputation: 242
man su
Code:
DESCRIPTION
       The su command is used to become another user during a login session.
       Invoked without a username, su defaults to becoming the superuser. The
       optional argument - may be used to provide an environment similar to
       what the user would expect had the user logged in directly.
man sudo
Code:
DESCRIPTION
       sudo allows a permitted user to execute a command as the superuser or
       another user, as specified in the sudoers file.
 
Old 12-19-2011, 11:26 AM   #13
hitmen
Member
 
Registered: Jun 2011
Distribution: Kubuntu 10.04
Posts: 158

Original Poster
Rep: Reputation: Disabled
They sound about the same to me.
Is a superuser also known as root? What is the difference ?
 
Old 12-19-2011, 11:09 PM   #14
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,356

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
superuser = root (this is the real admin's username; see first entry in /etc/passwd)
Code:
su = switch user
#As above, by default it switches you to root unless you specify otherwise
#http://linux.die.net/man/1/su

su <someuser>
note as above that this will switch user, but leave you with your original env. To get the target user's env, add '-' thus

Code:
# to root
su - 

# to otheruser
su - newuser
sudo http://linux.die.net/man/8/sudo temporarily enables you as a target user as allowed by the sudoers file http://linux.die.net/man/5/sudoers & limited to the cmds defined therein.

Last edited by chrism01; 12-19-2011 at 11:11 PM.
 
  


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
How to get a folder created in squirrelmail into outlook also ravis007 Linux - Server 1 01-18-2010 09:45 AM
Folder created by unkown programme shogun1234 Linux - General 3 10-27-2009 03:51 AM
unable to modify created and modification time of symbolic links avanigadhai Programming 4 03-02-2008 11:19 PM
can't delete a folder that I created. randell6564 Ubuntu 32 08-18-2006 02:14 AM
cant modify /usr/local/bin folder surgey Linux - Newbie 4 05-10-2005 05:52 PM


All times are GMT -5. The time now is 08:08 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration