cancel
Showing results for 
Search instead for 
Did you mean: 

Restore file linux

fernfrancis
Level 1

When i try to restore a full backup to another linux machine i get permission denied , is there any special way to go about restoration ?

I am using a non-priviledged account as i have disabled root on the server. i have allowed the non-privilege user access to the root account via sudoers but is there a way we can execute the restore with sudo as prefix before the restire command ?

3 REPLIES 3

pkh
Moderator
Moderator
   VIP    Certified

No. I do not believe so. There is no way to modify the restore.

You can restore the file to another location or machine and then copy the file to the required location.

virat8586
Level 3

Iguess there is no option to restore

pravinkumar_d
Level 3

As asaid above you cannot restore Linux system files to another system but you can restore share or files and folders which are not system related. But yes you must have root level access and the account must be part of beoper group as per requirement. But i have tested personally restoring without root and it worked for me in past.

Try below command may help you

To add user to beoper group

# usermod -G beoper useraccount

To re-enable root, do:

# sudo passwd root

To change password

passwd -d root

Or simply add edit the passwd file as below.

# vi /etc/passwd

In below example user name is john it may contain something as given below 1001:1001 you need to change it to 0:0 so that it will be part of root access.

Before

$ grep john /etc/passwd
john:x:1001:1001::/home/alice:/bin/sh

After

$ grep john /etc/passwd
john:x:0:0::/home/john:/bin/sh

 

Regards
Pravin Kumar D