LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 12-10-2018, 05:27 AM   #1
cbernardo
LQ Newbie
 
Registered: Dec 2018
Posts: 3

Rep: Reputation: Disabled
URGENT - root permission denied


HI everyone,

I'm trying to run ./gradlew :app:assembleStagingDebug in the root directory but if I try to access the root directory I'm getting permission denied.

Any Idea?
 
Old 12-10-2018, 05:29 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Run it with sudo
 
Old 12-10-2018, 05:32 AM   #3
cbernardo
LQ Newbie
 
Registered: Dec 2018
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TenTenths View Post
Run it with sudo
the problem is not running the command but try to enter in the root directory
 
Old 12-10-2018, 05:35 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by TenTenths View Post
Run it with sudo
Quote:
Originally Posted by cbernardo View Post
the problem is not running the command but try to enter in the root directory
And running the command with sudo will elevate the privileges of the command to the root user and thus give it permissions on any directory.
 
Old 12-10-2018, 05:39 AM   #5
cbernardo
LQ Newbie
 
Registered: Dec 2018
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TenTenths View Post
And running the command with sudo will elevate the privileges of the command to the root user and thus give it permissions on any directory.
How can I enter in the root directory ?
 
Old 12-10-2018, 05:41 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,849

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
it looks like post #2 has an answer.
 
Old 12-10-2018, 06:02 AM   #7
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
sudo su -
 
Old 12-10-2018, 06:03 AM   #8
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,830
Blog Entries: 17

Rep: Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638
Use su perhaps, and not sudo.
 
Old 12-10-2018, 06:11 AM   #9
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Become root. Login as root, or su, or sudo -i.

Then cd /root.

You could also change the permissions of /root or set a FACL, but I guess there is a reason why normal users are normally not allowed in /root.

Last edited by berndbausch; 12-10-2018 at 06:13 AM.
 
Old 12-10-2018, 07:38 AM   #10
snowday
Senior Member
 
Registered: Feb 2009
Posts: 4,667

Rep: Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411
Quote:
Originally Posted by cbernardo View Post
How can I enter in the root directory ?
With 'sudo' as everyone keeps telling you:

Code:
sudo cd /root
HOWEVER why are you doing this in your /root folder? Why not set up a proper build/working folder in your user's /home? Please check the Gradle documentation and make sure you're doing it right.

Last edited by snowday; 12-10-2018 at 07:39 AM.
 
Old 12-10-2018, 07:41 AM   #11
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
Quote:
Code:
sudo cd /root
I tried that on my ubuntu system before posting and received a command not found error.
 
Old 12-10-2018, 07:44 AM   #12
snowday
Senior Member
 
Registered: Feb 2009
Posts: 4,667

Rep: Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411
Quote:
Originally Posted by colorpurple21859 View Post
I tried that on my ubuntu system before posting and received a command not found error.
What is the exact error message please? Is it telling you 'sudo' not found, or 'cd' not found?

Can you try /usr/bin/cd instead of cd?
 
Old 12-10-2018, 07:55 AM   #13
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
cd not found, I didn't try "sudo /usr/bin/cd"


edit: "sudo /usr/bin/cd" same results /usr/bin/cd not found

Last edited by colorpurple21859; 12-10-2018 at 08:06 AM.
 
Old 12-10-2018, 08:06 AM   #14
snowday
Senior Member
 
Registered: Feb 2009
Posts: 4,667

Rep: Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411
Quote:
Originally Posted by colorpurple21859 View Post
cd not found, I didn't try "sudo /usr/bin/cd"
Interesting, Ubuntu can be a little quirky like that sometimes. Try "which cd"?

It's all academic anyway, since I don't think the OP really needs to be in the /root folder. The Gradle Getting Started Guide makes frequent reference to the "root project build" and I think the OP has misinterpreted that as root's home folder /root.

Last edited by snowday; 12-10-2018 at 09:01 AM.
 
Old 12-10-2018, 08:32 PM   #15
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,150

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Would this like help: https://stackoverflow.com/questions/...s-sudo-gradlew

From link above: I switched to root to check ~/.gradle, and found the files were quite complete
 
  


Reply



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
[SOLVED] Permission denied as root to a root-owned directory threevolve Ubuntu 3 06-06-2013 07:27 AM
mkdir throws Permission Denied error in a directoy even with root ownership and 777 permission surajchalukya Linux - Security 14 09-03-2012 08:34 AM
[SOLVED] URGENT::Unable to open pty: Permission denied while trying to login to vps node dontob Linux - Newbie 2 03-08-2011 05:14 AM
can't execute c++ binaries, "permission denied"... even though permission is 777 SerfurJ Programming 14 02-20-2009 04:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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