LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Copying files in an admin account from an account with insufficient permissions? (https://www.linuxquestions.org/questions/linux-general-1/copying-files-in-an-admin-account-from-an-account-with-insufficient-permissions-949469/)

nobuntu 06-10-2012 01:38 AM

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

evo2 06-10-2012 01:51 AM

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").

jefro 06-10-2012 12:42 PM

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.

nobuntu 06-10-2012 01:18 PM

Quote:

Originally Posted by evo2 (Post 4699857)
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 (Post 4700080)
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

evo2 06-10-2012 06:40 PM

Hi,

did you read the error message?

Try:
Code:

/usr/sbin/usermod -a -G admin mom
Cheers,

Evo2.

evo2 06-10-2012 07:34 PM

Hi,

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

Quote:

Originally Posted by R3nCi (Post 4700096)
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.

nobuntu 06-14-2012 09:59 PM

Quote:

Originally Posted by evo2 (Post 4700247)
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. :)

nobuntu 07-01-2012 04:00 PM

Quote:

Originally Posted by R3nCi (Post 4703666)
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'
:banghead:

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

evo2 07-01-2012 07:57 PM

Hi,

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

Evo2.

nobuntu 07-02-2012 06:14 PM

Quote:

Originally Posted by evo2 (Post 4716728)
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!

chrism01 07-03-2012 12:22 AM

To clarify, a+r = all+read :)
HTH

nobuntu 07-08-2012 04:02 PM

Quote:

Originally Posted by chrism01 (Post 4717774)
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. :D

Lawrence

lithos 07-08-2012 05:40 PM

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.

nobuntu 07-13-2012 11:30 PM

Quote:

Originally Posted by lithos (Post 4722458)
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! :)

lithos 07-14-2012 02:14 AM

Great ! I'm glad you can get your files back.


All times are GMT -5. The time now is 08:44 AM.