I always have to access Jupyter Notebook as a root user

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












Every time, I use Jupyter Notebook in Ubuntu 18.04, I have to access sudo bash first and then type jupyter notebook --allow-root to use Jupyter Notebook without any problem. This is because when I use normal user to access jupyter notebook, I will always get this error.
enter image description here



Every time I try to create new jupyter notebook workspace, I will get this error. I can't just type $ jupyter notebook to use Jupyter workspace and save my new creation.



Please, could you tell me how to fix this issue?



UPDATE



This is what I see in /home/sura/.local/share/jupyter/notebook_secret using sudo nano



enter image description here



And this is what I see in ls -l /home/sura/.local/share/jupyter



enter image description here







share|improve this question






















  • Have you checked the permissions of /home/sura/.local/share/jupyter/notebook_secret? Run ls -l /home/sura/.local/share/jupyter and add the output to your question.
    – Lienhart Woitok
    May 20 at 11:12










  • Yes, I have checked the path /home/sura/.local/share/jupyter/notebook_secret, but there is nothing in there. It's totally empty.
    – Liu Bei
    May 20 at 11:34










  • I have updated all the requirements you need to see, do you have any solution for my issue? It seems that Jupyter Notebook was set to be used as root.
    – Liu Bei
    May 20 at 11:48











  • It is far easier for people to help you if in future you just copy and paste output from commands into your answer and mark them as code using the '' button instead of posting screenshots.
    – Lienhart Woitok
    May 20 at 12:16










  • I am so sorry. I will improve myself. By the way, do you have any solutions?
    – Liu Bei
    May 20 at 12:25














up vote
0
down vote

favorite












Every time, I use Jupyter Notebook in Ubuntu 18.04, I have to access sudo bash first and then type jupyter notebook --allow-root to use Jupyter Notebook without any problem. This is because when I use normal user to access jupyter notebook, I will always get this error.
enter image description here



Every time I try to create new jupyter notebook workspace, I will get this error. I can't just type $ jupyter notebook to use Jupyter workspace and save my new creation.



Please, could you tell me how to fix this issue?



UPDATE



This is what I see in /home/sura/.local/share/jupyter/notebook_secret using sudo nano



enter image description here



And this is what I see in ls -l /home/sura/.local/share/jupyter



enter image description here







share|improve this question






















  • Have you checked the permissions of /home/sura/.local/share/jupyter/notebook_secret? Run ls -l /home/sura/.local/share/jupyter and add the output to your question.
    – Lienhart Woitok
    May 20 at 11:12










  • Yes, I have checked the path /home/sura/.local/share/jupyter/notebook_secret, but there is nothing in there. It's totally empty.
    – Liu Bei
    May 20 at 11:34










  • I have updated all the requirements you need to see, do you have any solution for my issue? It seems that Jupyter Notebook was set to be used as root.
    – Liu Bei
    May 20 at 11:48











  • It is far easier for people to help you if in future you just copy and paste output from commands into your answer and mark them as code using the '' button instead of posting screenshots.
    – Lienhart Woitok
    May 20 at 12:16










  • I am so sorry. I will improve myself. By the way, do you have any solutions?
    – Liu Bei
    May 20 at 12:25












up vote
0
down vote

favorite









up vote
0
down vote

favorite











Every time, I use Jupyter Notebook in Ubuntu 18.04, I have to access sudo bash first and then type jupyter notebook --allow-root to use Jupyter Notebook without any problem. This is because when I use normal user to access jupyter notebook, I will always get this error.
enter image description here



Every time I try to create new jupyter notebook workspace, I will get this error. I can't just type $ jupyter notebook to use Jupyter workspace and save my new creation.



Please, could you tell me how to fix this issue?



UPDATE



This is what I see in /home/sura/.local/share/jupyter/notebook_secret using sudo nano



enter image description here



And this is what I see in ls -l /home/sura/.local/share/jupyter



enter image description here







share|improve this question














Every time, I use Jupyter Notebook in Ubuntu 18.04, I have to access sudo bash first and then type jupyter notebook --allow-root to use Jupyter Notebook without any problem. This is because when I use normal user to access jupyter notebook, I will always get this error.
enter image description here



Every time I try to create new jupyter notebook workspace, I will get this error. I can't just type $ jupyter notebook to use Jupyter workspace and save my new creation.



Please, could you tell me how to fix this issue?



UPDATE



This is what I see in /home/sura/.local/share/jupyter/notebook_secret using sudo nano



enter image description here



And this is what I see in ls -l /home/sura/.local/share/jupyter



enter image description here









share|improve this question













share|improve this question




share|improve this question








edited May 20 at 11:47

























asked May 20 at 10:25









Liu Bei

356




356











  • Have you checked the permissions of /home/sura/.local/share/jupyter/notebook_secret? Run ls -l /home/sura/.local/share/jupyter and add the output to your question.
    – Lienhart Woitok
    May 20 at 11:12










  • Yes, I have checked the path /home/sura/.local/share/jupyter/notebook_secret, but there is nothing in there. It's totally empty.
    – Liu Bei
    May 20 at 11:34










  • I have updated all the requirements you need to see, do you have any solution for my issue? It seems that Jupyter Notebook was set to be used as root.
    – Liu Bei
    May 20 at 11:48











  • It is far easier for people to help you if in future you just copy and paste output from commands into your answer and mark them as code using the '' button instead of posting screenshots.
    – Lienhart Woitok
    May 20 at 12:16










  • I am so sorry. I will improve myself. By the way, do you have any solutions?
    – Liu Bei
    May 20 at 12:25
















  • Have you checked the permissions of /home/sura/.local/share/jupyter/notebook_secret? Run ls -l /home/sura/.local/share/jupyter and add the output to your question.
    – Lienhart Woitok
    May 20 at 11:12










  • Yes, I have checked the path /home/sura/.local/share/jupyter/notebook_secret, but there is nothing in there. It's totally empty.
    – Liu Bei
    May 20 at 11:34










  • I have updated all the requirements you need to see, do you have any solution for my issue? It seems that Jupyter Notebook was set to be used as root.
    – Liu Bei
    May 20 at 11:48











  • It is far easier for people to help you if in future you just copy and paste output from commands into your answer and mark them as code using the '' button instead of posting screenshots.
    – Lienhart Woitok
    May 20 at 12:16










  • I am so sorry. I will improve myself. By the way, do you have any solutions?
    – Liu Bei
    May 20 at 12:25















Have you checked the permissions of /home/sura/.local/share/jupyter/notebook_secret? Run ls -l /home/sura/.local/share/jupyter and add the output to your question.
– Lienhart Woitok
May 20 at 11:12




Have you checked the permissions of /home/sura/.local/share/jupyter/notebook_secret? Run ls -l /home/sura/.local/share/jupyter and add the output to your question.
– Lienhart Woitok
May 20 at 11:12












Yes, I have checked the path /home/sura/.local/share/jupyter/notebook_secret, but there is nothing in there. It's totally empty.
– Liu Bei
May 20 at 11:34




Yes, I have checked the path /home/sura/.local/share/jupyter/notebook_secret, but there is nothing in there. It's totally empty.
– Liu Bei
May 20 at 11:34












I have updated all the requirements you need to see, do you have any solution for my issue? It seems that Jupyter Notebook was set to be used as root.
– Liu Bei
May 20 at 11:48





I have updated all the requirements you need to see, do you have any solution for my issue? It seems that Jupyter Notebook was set to be used as root.
– Liu Bei
May 20 at 11:48













It is far easier for people to help you if in future you just copy and paste output from commands into your answer and mark them as code using the '' button instead of posting screenshots.
– Lienhart Woitok
May 20 at 12:16




It is far easier for people to help you if in future you just copy and paste output from commands into your answer and mark them as code using the '' button instead of posting screenshots.
– Lienhart Woitok
May 20 at 12:16












I am so sorry. I will improve myself. By the way, do you have any solutions?
– Liu Bei
May 20 at 12:25




I am so sorry. I will improve myself. By the way, do you have any solutions?
– Liu Bei
May 20 at 12:25










1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










Disclaimer: I have no experience with Jupyter.



It seems that your Jupyter data files are owned by root and therefore your user may not write to them. This is most probably the case because you ran Jupyter as root.



To rectify, you need to change the ownership of the files to your user.



Run sudo chown -R sura:sura /home/sura/.local/share/jupyter and test if it works now. If it still does not work, check the error message. After the term "permission denied" is a path. Check the permissions of that path (ls -l <path>) and if the file or directory belongs to root, change then owner (sudo chown -R sura:sura <path>).



Afterwards, never run Jupyter as root, always as your user.






share|improve this answer




















  • Hello, the solution you gave me causes another error. Unexpected error while saving file: Documents/python/Untitled.ipynb [Errno 13] Permission denied: u'/home/sura/Documents/python/.ipynb_checkpoints/Untitled-checkpoint.ipynb' I don't know why this can happen, hahahaha
    – Liu Bei
    May 20 at 12:24











  • As stated, you need to repeat that process (check ownership and fix it) until you can save again. I suspect you have a bunch of files used by Jupyter and owned by root scattered all over your home directory. For this file you should check ownership of /home/sura/Documents/python/ and /home/sura/Documents/python/.ipynb_checkpoints using ls -l path. If either belongs to root, run sudo chown -R sura:sura on it. If unsure you can just run sudo chown -R sura:sura /home/sura/Documents/python and keep your fingers crossed.
    – Lienhart Woitok
    May 20 at 12:33











  • Hello, I can fix this issue by using your way. I have used sudo chown -R sura:sura /home/sura/Documents/python/.ipynb_checkpoints at the end. Thank you very much
    – Liu Bei
    May 20 at 12:33










  • Now I can just type $ jupyter notebook in the terminal. And also I can use jupyter notebook as root.
    – Liu Bei
    May 20 at 12:37










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1038339%2fi-always-have-to-access-jupyter-notebook-as-a-root-user%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










Disclaimer: I have no experience with Jupyter.



It seems that your Jupyter data files are owned by root and therefore your user may not write to them. This is most probably the case because you ran Jupyter as root.



To rectify, you need to change the ownership of the files to your user.



Run sudo chown -R sura:sura /home/sura/.local/share/jupyter and test if it works now. If it still does not work, check the error message. After the term "permission denied" is a path. Check the permissions of that path (ls -l <path>) and if the file or directory belongs to root, change then owner (sudo chown -R sura:sura <path>).



Afterwards, never run Jupyter as root, always as your user.






share|improve this answer




















  • Hello, the solution you gave me causes another error. Unexpected error while saving file: Documents/python/Untitled.ipynb [Errno 13] Permission denied: u'/home/sura/Documents/python/.ipynb_checkpoints/Untitled-checkpoint.ipynb' I don't know why this can happen, hahahaha
    – Liu Bei
    May 20 at 12:24











  • As stated, you need to repeat that process (check ownership and fix it) until you can save again. I suspect you have a bunch of files used by Jupyter and owned by root scattered all over your home directory. For this file you should check ownership of /home/sura/Documents/python/ and /home/sura/Documents/python/.ipynb_checkpoints using ls -l path. If either belongs to root, run sudo chown -R sura:sura on it. If unsure you can just run sudo chown -R sura:sura /home/sura/Documents/python and keep your fingers crossed.
    – Lienhart Woitok
    May 20 at 12:33











  • Hello, I can fix this issue by using your way. I have used sudo chown -R sura:sura /home/sura/Documents/python/.ipynb_checkpoints at the end. Thank you very much
    – Liu Bei
    May 20 at 12:33










  • Now I can just type $ jupyter notebook in the terminal. And also I can use jupyter notebook as root.
    – Liu Bei
    May 20 at 12:37














up vote
1
down vote



accepted










Disclaimer: I have no experience with Jupyter.



It seems that your Jupyter data files are owned by root and therefore your user may not write to them. This is most probably the case because you ran Jupyter as root.



To rectify, you need to change the ownership of the files to your user.



Run sudo chown -R sura:sura /home/sura/.local/share/jupyter and test if it works now. If it still does not work, check the error message. After the term "permission denied" is a path. Check the permissions of that path (ls -l <path>) and if the file or directory belongs to root, change then owner (sudo chown -R sura:sura <path>).



Afterwards, never run Jupyter as root, always as your user.






share|improve this answer




















  • Hello, the solution you gave me causes another error. Unexpected error while saving file: Documents/python/Untitled.ipynb [Errno 13] Permission denied: u'/home/sura/Documents/python/.ipynb_checkpoints/Untitled-checkpoint.ipynb' I don't know why this can happen, hahahaha
    – Liu Bei
    May 20 at 12:24











  • As stated, you need to repeat that process (check ownership and fix it) until you can save again. I suspect you have a bunch of files used by Jupyter and owned by root scattered all over your home directory. For this file you should check ownership of /home/sura/Documents/python/ and /home/sura/Documents/python/.ipynb_checkpoints using ls -l path. If either belongs to root, run sudo chown -R sura:sura on it. If unsure you can just run sudo chown -R sura:sura /home/sura/Documents/python and keep your fingers crossed.
    – Lienhart Woitok
    May 20 at 12:33











  • Hello, I can fix this issue by using your way. I have used sudo chown -R sura:sura /home/sura/Documents/python/.ipynb_checkpoints at the end. Thank you very much
    – Liu Bei
    May 20 at 12:33










  • Now I can just type $ jupyter notebook in the terminal. And also I can use jupyter notebook as root.
    – Liu Bei
    May 20 at 12:37












up vote
1
down vote



accepted







up vote
1
down vote



accepted






Disclaimer: I have no experience with Jupyter.



It seems that your Jupyter data files are owned by root and therefore your user may not write to them. This is most probably the case because you ran Jupyter as root.



To rectify, you need to change the ownership of the files to your user.



Run sudo chown -R sura:sura /home/sura/.local/share/jupyter and test if it works now. If it still does not work, check the error message. After the term "permission denied" is a path. Check the permissions of that path (ls -l <path>) and if the file or directory belongs to root, change then owner (sudo chown -R sura:sura <path>).



Afterwards, never run Jupyter as root, always as your user.






share|improve this answer












Disclaimer: I have no experience with Jupyter.



It seems that your Jupyter data files are owned by root and therefore your user may not write to them. This is most probably the case because you ran Jupyter as root.



To rectify, you need to change the ownership of the files to your user.



Run sudo chown -R sura:sura /home/sura/.local/share/jupyter and test if it works now. If it still does not work, check the error message. After the term "permission denied" is a path. Check the permissions of that path (ls -l <path>) and if the file or directory belongs to root, change then owner (sudo chown -R sura:sura <path>).



Afterwards, never run Jupyter as root, always as your user.







share|improve this answer












share|improve this answer



share|improve this answer










answered May 20 at 12:16









Lienhart Woitok

808211




808211











  • Hello, the solution you gave me causes another error. Unexpected error while saving file: Documents/python/Untitled.ipynb [Errno 13] Permission denied: u'/home/sura/Documents/python/.ipynb_checkpoints/Untitled-checkpoint.ipynb' I don't know why this can happen, hahahaha
    – Liu Bei
    May 20 at 12:24











  • As stated, you need to repeat that process (check ownership and fix it) until you can save again. I suspect you have a bunch of files used by Jupyter and owned by root scattered all over your home directory. For this file you should check ownership of /home/sura/Documents/python/ and /home/sura/Documents/python/.ipynb_checkpoints using ls -l path. If either belongs to root, run sudo chown -R sura:sura on it. If unsure you can just run sudo chown -R sura:sura /home/sura/Documents/python and keep your fingers crossed.
    – Lienhart Woitok
    May 20 at 12:33











  • Hello, I can fix this issue by using your way. I have used sudo chown -R sura:sura /home/sura/Documents/python/.ipynb_checkpoints at the end. Thank you very much
    – Liu Bei
    May 20 at 12:33










  • Now I can just type $ jupyter notebook in the terminal. And also I can use jupyter notebook as root.
    – Liu Bei
    May 20 at 12:37
















  • Hello, the solution you gave me causes another error. Unexpected error while saving file: Documents/python/Untitled.ipynb [Errno 13] Permission denied: u'/home/sura/Documents/python/.ipynb_checkpoints/Untitled-checkpoint.ipynb' I don't know why this can happen, hahahaha
    – Liu Bei
    May 20 at 12:24











  • As stated, you need to repeat that process (check ownership and fix it) until you can save again. I suspect you have a bunch of files used by Jupyter and owned by root scattered all over your home directory. For this file you should check ownership of /home/sura/Documents/python/ and /home/sura/Documents/python/.ipynb_checkpoints using ls -l path. If either belongs to root, run sudo chown -R sura:sura on it. If unsure you can just run sudo chown -R sura:sura /home/sura/Documents/python and keep your fingers crossed.
    – Lienhart Woitok
    May 20 at 12:33











  • Hello, I can fix this issue by using your way. I have used sudo chown -R sura:sura /home/sura/Documents/python/.ipynb_checkpoints at the end. Thank you very much
    – Liu Bei
    May 20 at 12:33










  • Now I can just type $ jupyter notebook in the terminal. And also I can use jupyter notebook as root.
    – Liu Bei
    May 20 at 12:37















Hello, the solution you gave me causes another error. Unexpected error while saving file: Documents/python/Untitled.ipynb [Errno 13] Permission denied: u'/home/sura/Documents/python/.ipynb_checkpoints/Untitled-checkpoint.ipynb' I don't know why this can happen, hahahaha
– Liu Bei
May 20 at 12:24





Hello, the solution you gave me causes another error. Unexpected error while saving file: Documents/python/Untitled.ipynb [Errno 13] Permission denied: u'/home/sura/Documents/python/.ipynb_checkpoints/Untitled-checkpoint.ipynb' I don't know why this can happen, hahahaha
– Liu Bei
May 20 at 12:24













As stated, you need to repeat that process (check ownership and fix it) until you can save again. I suspect you have a bunch of files used by Jupyter and owned by root scattered all over your home directory. For this file you should check ownership of /home/sura/Documents/python/ and /home/sura/Documents/python/.ipynb_checkpoints using ls -l path. If either belongs to root, run sudo chown -R sura:sura on it. If unsure you can just run sudo chown -R sura:sura /home/sura/Documents/python and keep your fingers crossed.
– Lienhart Woitok
May 20 at 12:33





As stated, you need to repeat that process (check ownership and fix it) until you can save again. I suspect you have a bunch of files used by Jupyter and owned by root scattered all over your home directory. For this file you should check ownership of /home/sura/Documents/python/ and /home/sura/Documents/python/.ipynb_checkpoints using ls -l path. If either belongs to root, run sudo chown -R sura:sura on it. If unsure you can just run sudo chown -R sura:sura /home/sura/Documents/python and keep your fingers crossed.
– Lienhart Woitok
May 20 at 12:33













Hello, I can fix this issue by using your way. I have used sudo chown -R sura:sura /home/sura/Documents/python/.ipynb_checkpoints at the end. Thank you very much
– Liu Bei
May 20 at 12:33




Hello, I can fix this issue by using your way. I have used sudo chown -R sura:sura /home/sura/Documents/python/.ipynb_checkpoints at the end. Thank you very much
– Liu Bei
May 20 at 12:33












Now I can just type $ jupyter notebook in the terminal. And also I can use jupyter notebook as root.
– Liu Bei
May 20 at 12:37




Now I can just type $ jupyter notebook in the terminal. And also I can use jupyter notebook as root.
– Liu Bei
May 20 at 12:37












 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1038339%2fi-always-have-to-access-jupyter-notebook-as-a-root-user%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

pylint3 and pip3 broken

Missing snmpget and snmpwalk

How to enroll fingerprints to Ubuntu 17.10 with VFS491