Home » Questions » Computers [ Ask a new question ]

How to copy files & directories as a Sudo User

How to copy files & directories as a Sudo User

I login to linux using my Id eg "A". then i'll sudo to the user 'B' without entering the password, after that i'll copy some files from X folder to Y Folder using the SUdo user 'B'.

Asked by: Guest | Views: 306
Total answers/comments: 1
bert [Entry]

sudo is an interactive command. Using it in cron jobs does not make sense. Either you create a super user script to copy all the files and then change the ownership, or run the script by the required user itself.