LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-10-2012, 01:38 AM   #1
nobuntu
Member
 
Registered: Mar 2012
Distribution: Debian for server, CrunchBang for everything that's not a server
Posts: 143

Rep: Reputation: 24
Copying files in an admin account from an account with insufficient permissions?


Hello,

A few months ago, I ran into a distressing problem with my primary (administrator) account on my existing installation of elementary OS Jupiter: in the middle of using Rhythmbox, the mouse cursor froze entirely, and the keyboard stopped working. This made the admin account more-or-less unusable, as upon logging in the mouse and keyboard immediately stopped working.

Since the surfacing of this issue, I have not been using the admin account; instead, I have been using a non-privileged secondary account created while I still had access to the primary account.

This lockout of my admin account means that I can't access about half of my files. When navigating from the secondary account's Home folder to the root of the file system, to the admin account's Home folder and then to the subfolders therein, I see that a large number of files are marked as having insufficient permissions for use on the secondary account.

This, and other problems with elementary OS have caused me to make a decision to switch Debian 6.0.5. However, I cannot switch until I can copy my full admin and secondary accounts' Home folders.

Is there some way I can manipulate the permissions of the admin account's Home folder from the non-privileged account, or copy my full Home folders some other way?

Thank you,

Lawrence
 
Old 06-10-2012, 01:51 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726

Rep: Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706
Hi,

sounds like a problem with the gui config for that account. Is there anything stopping you from using su in a terminal to change to that user? Or even just logging in as that user on a console (eg Ctrl-Alt-F1)? Then you can do whatever you want including adding your "non-priveged" account to the adm group.
Eg
Code:
su -l adminuser
usermod -a -G admin nonprivuser
Where "adminuser" and "nonprivuser" are the usernames.
Then log out and log back in agina as nonprivuser and you should be able to sudo to gain root privs.

Evo2.

PS. All this is assuming that "elementary OS Jupiter" behaves like a standard Ubuntu system (which seems to be the case with the majority of Ubuntu derived/rebranded/extrapackages "distros").
 
1 members found this post helpful.
Old 06-10-2012, 12:42 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,361

Rep: Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692
I'd wonder about the filesystem, memory, hard drive or other data issue.

Admin accounts don't usually sort of work.

Might boot to a live cd to peek into it and move it.


Any terminal or console should allow you to use su unless it has been blocked by disto or other. sudo some file manager may work but a live cd usually is a way to access it.

Last edited by jefro; 06-10-2012 at 12:45 PM.
 
Old 06-10-2012, 01:18 PM   #4
nobuntu
Member
 
Registered: Mar 2012
Distribution: Debian for server, CrunchBang for everything that's not a server
Posts: 143

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by evo2 View Post
Hi,

sounds like a problem with the gui config for that account. Is there anything stopping you from using su in a terminal to change to that user? Or even just logging in as that user on a console (eg Ctrl-Alt-F1)? Then you can do whatever you want including adding your "non-priveged" account to the adm group.
Eg
Code:
su -l adminuser
usermod -a -G admin nonprivuser
Where "adminuser" and "nonprivuser" are the usernames.
Then log out and log back in agina as nonprivuser and you should be able to sudo to gain root privs.

Evo2.

PS. All this is assuming that "elementary OS Jupiter" behaves like a standard Ubuntu system (which seems to be the case with the majority of Ubuntu derived/rebranded/extrapackages "distros").
Thank you for your help. I tried your solution, but it didn't seem to work. Am I doing something wrong?

Code:
Ubuntu 10.10 Dawn ttyl
Dawn login: lawrence
Password:
run-parts: failed to exec /etc/update-motd.d/10-help-text: Exec format error
run-parts: /etc/update-motd.d/10-help-text exited with return code 1
Linux Dawn 2.6.35-32-generic #67-Ubuntu SMP Mom Mar 5 19:35:26 UTC 2012 i686 GNU/Linux
elementary-jupiter

0 packages can be updated.
0 updates are security updates.

lawrence@Dawn:~$ su -l lawrence
Password:
lawrence@Dawn:~$ usermod -a -G admin mom
Command 'usermod' is available in '/usr/sbin/usermod'
The command could not be located because 'usermod' is not included in the PATH environment variable.
This is most likely caused by the lack of administrative privileges associated with your user account.
usermod: command not found
lawrence@Dawn:"$
Please note that the above session record was hand-transcribed and may contain errors.

I did try the plain-and-simple GUI route (System>Administration>Users And Groups>enter admin password>Change user mom to administrator), but this is not giving me the necessary permissions to access my files either, although I can now sudo in Terminal. Is there some Terminal route for mass-changing file permissions/ownership to mom from lawrence, or to give all users access to read/write permissions on given folders? chmod?

Quote:
Originally Posted by jefro View Post
I'd wonder about the filesystem, memory, hard drive or other data issue.

Admin accounts don't usually sort of work.

Might boot to a live cd to peek into it and move it.


Any terminal or console should allow you to use su unless it has been blocked by disto or other. sudo some file manager may work but a live cd usually is a way to access it.
I did try booting to a live CD of Ubuntu 10.04 that a friend had, and it showed exactly the same behavior as my elementary OS installation.


Thanks,

Lawrence

Last edited by nobuntu; 06-10-2012 at 01:20 PM.
 
Old 06-10-2012, 06:40 PM   #5
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726

Rep: Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706
Hi,

did you read the error message?

Try:
Code:
/usr/sbin/usermod -a -G admin mom
Cheers,

Evo2.
 
Old 06-10-2012, 07:34 PM   #6
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726

Rep: Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706
Hi,

opps, seems I did not read enough of your last post.

Quote:
Originally Posted by R3nCi View Post
System>Administration>Users And Groups>enter admin password>Change user mom to administrator), but this is not giving me the necessary permissions to access my files either, although I can now sudo in Terminal.
Ok, so looks like you were able to do the equivalent of usermod command using the gui. Good.
Quote:
Is there some Terminal route for mass-changing file permissions/ownership to mom from lawrence, or to give all users access to read/write permissions on given folders? chmod?
Yes. In fact I don't know of any other way (but avoid guis whenever I can). chmod is used for changing the permissoins, chown for changing the ownership.

Eg. if you want to change the owner to lawrence and the group to lawrence for all files/directories under /home/mom you could run the following:
Code:
chown -R lawrence.lawrence /home/mom
Or if you wanted to make all files and directories under /home/mom to be readable by everyone (including lawrence) you could do
Code:
chmod -R a+r /home/mom
HTH,

Evo2.
 
Old 06-14-2012, 09:59 PM   #7
nobuntu
Member
 
Registered: Mar 2012
Distribution: Debian for server, CrunchBang for everything that's not a server
Posts: 143

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by evo2 View Post
Eg. if you want to change the owner to lawrence and the group to lawrence for all files/directories under /home/mom you could run the following:
Code:
chown -R lawrence.lawrence /home/mom
Or if you wanted to make all files and directories under /home/mom to be readable by everyone (including lawrence) you could do
Code:
chmod -R a+r /home/mom
HTH,

Evo2.
Thank you very much; I will try running these Friday evening.
 
Old 07-01-2012, 04:00 PM   #8
nobuntu
Member
 
Registered: Mar 2012
Distribution: Debian for server, CrunchBang for everything that's not a server
Posts: 143

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by R3nCi View Post
Thank you very much; I will try running these Friday evening.
Well, I finally got around to running the commands you suggested. Unfortunately, I was not met with success.

Quote:
chmod: invalid mode: 'atr'


I have 101 GB of data in that account, a decent amount of which I cannot access. Music (including original works), photography, video footage, etc. I need to be able to get to it in order to back up my HDD for an impending move to Debian 6.0.5, as the current version of elementary OS is based on Ubuntu 10.10 and since 10.10 is EOL, I cannot get important security updates - obviously not a good situation.

Thank you for any help you can provide.

Lawrence
 
Old 07-01-2012, 07:57 PM   #9
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726

Rep: Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706
Hi,

it is "a+r" not "atr".

Evo2.
 
Old 07-02-2012, 06:14 PM   #10
nobuntu
Member
 
Registered: Mar 2012
Distribution: Debian for server, CrunchBang for everything that's not a server
Posts: 143

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by evo2 View Post
Hi,

it is "a+r" not "atr".

Evo2.
Oh, haha. Epic fail on my part. Sorry! I'll try running this again soon, and report back with the results. Wish me luck!
 
Old 07-03-2012, 12:22 AM   #11
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.x
Posts: 18,434

Rep: Reputation: 2790Reputation: 2790Reputation: 2790Reputation: 2790Reputation: 2790Reputation: 2790Reputation: 2790Reputation: 2790Reputation: 2790Reputation: 2790Reputation: 2790
To clarify, a+r = all+read
HTH
 
Old 07-08-2012, 04:02 PM   #12
nobuntu
Member
 
Registered: Mar 2012
Distribution: Debian for server, CrunchBang for everything that's not a server
Posts: 143

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by chrism01 View Post
To clarify, a+r = all+read
HTH
Hello,

I tried running this, and something extremely strange happened. The console/terminal was running through everything in my home directory, attempting to change the permissions, and each and every item showed a Operation Not Permitted error. The account I was running the commands from (lawrence) was an administrator account. Neither it nor "mom" would allow me to execute the command correctly.

I rebooted the system, and when trying to run the command again, only one file was on the screen as having its permissions changed, and it too left me with an Operation Not Permitted error.

If you are having trouble understanding this, I can make a short video showing exactly what is happening. I'm off to lunch right now, but will check for your (or any!) response when I return.

I don't know what do from this point forward. I can't get my data, my computer is not getting security updates, so I am essentially stuck in a cycle of Permission Denied, Permission Denied.

Thank you very much for all your help so far.

Lawrence

Last edited by nobuntu; 07-08-2012 at 04:55 PM.
 
Old 07-08-2012, 05:40 PM   #13
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi Lawrence

I'm sorry getting to this thread without Ubuntu (jupiter) knowledge, but reading the posts I wonder if you could
open a terminal window and become "root" user (like in most Linux distros) which would possibly help you to save the files you need.

What do you think about it - evo2 ?

Usually you become "root" user with:
Code:
# sudo su -

and then entering "root" user's password or the "username" password (can be your mom or lawrence's)

or it can be:

# su -

looking here is an explanation of "su"

then you could change permissions and owner of your files
Code:
# cd /home/lawrence
# chmod -vR 777 foldername_you_want_access/ 

and this is again like "evo2" wrote, change "owner"
# chown -R mom.mom  foldername_you_want_access/
this should change file/folder permissions for "anyone" to read/write/execute.

There is a possibility you will break something with "chown" command,


... what comes about to my mind is that you can't access your (lawrence's) files from "mom's" account login
is that "lawrence's" home and all other directories are owned by that user and probably don't have permissions for others to "read/execute" them.
So it probably needs to have change the permissions for "lawrence's" home (again by "root")
Code:
# chmod 777 /home/lawrence
which will allow any other user to open "lawrence's" directory (but not any other subdir.. - if you need it -- change that too).

I hope it will work for you.

Last edited by lithos; 07-08-2012 at 05:49 PM.
 
1 members found this post helpful.
Old 07-13-2012, 11:30 PM   #14
nobuntu
Member
 
Registered: Mar 2012
Distribution: Debian for server, CrunchBang for everything that's not a server
Posts: 143

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by lithos View Post
Hi Lawrence

I'm sorry getting to this thread without Ubuntu (jupiter) knowledge, but reading the posts I wonder if you could
open a terminal window and become "root" user (like in most Linux distros) which would possibly help you to save the files you need.

What do you think about it - evo2 ?

Usually you become "root" user with:
Code:
# sudo su -

and then entering "root" user's password or the "username" password (can be your mom or lawrence's)

or it can be:

# su -

looking here is an explanation of "su"

then you could change permissions and owner of your files
Code:
# cd /home/lawrence
# chmod -vR 777 foldername_you_want_access/ 

and this is again like "evo2" wrote, change "owner"
# chown -R mom.mom  foldername_you_want_access/
this should change file/folder permissions for "anyone" to read/write/execute.

There is a possibility you will break something with "chown" command,


... what comes about to my mind is that you can't access your (lawrence's) files from "mom's" account login
is that "lawrence's" home and all other directories are owned by that user and probably don't have permissions for others to "read/execute" them.
So it probably needs to have change the permissions for "lawrence's" home (again by "root")
Code:
# chmod 777 /home/lawrence
which will allow any other user to open "lawrence's" directory (but not any other subdir.. - if you need it -- change that too).

I hope it will work for you.
This worked perfectly. Thank you so much!
 
Old 07-14-2012, 02:14 AM   #15
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Great ! I'm glad you can get your files back.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Erased old account for new one; forgot to give admin priv to new account. RHLinuxGUY Ubuntu 3 08-10-2008 07:56 PM
creating admin account venki Linux - Networking 2 10-26-2006 02:15 AM
is it legitimate and allowed and can be done to make another user account set uid and gid to null 0 to make another root account with different name and possibly not damage the debian system creating and using that new account BenJoBoy Linux - Newbie 12 01-29-2006 10:02 AM
Making an account an admin? sleepykit Mandriva 9 11-23-2005 05:51 PM
admin account recovery rajivb Linux - Newbie 4 02-20-2005 02:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:27 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