Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of bash:/root/.bashrc:Permission denied

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces the relevant knowledge of "how to solve the problem of bash:/root/.bashrc:Permission denied". In the operation of actual cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

This is a question of file permissions:

You can check the file permissions:

Root@0d71811f7c01:/usr/local/src# ls-al ~ / total 32drwx-1 root root 4096 Nov 17 23:34. Drwxr-xr-x 1 root root 4096 Nov 10 14:57.-rw- 1 root root 523 Nov 17 23:34. Bash _ history-rwSr-Sr-- 1 root root 570 Jan 31 2010. Bashrcdrwx-3 root root 4096 Nov 17 15:25. Cache-rw-r--r-- 1 root root 126 Nov 3 14 : 57.gitconfig-rw-r--r-- 1 root root 148Aug 17 2015. Profile-rw-r--r-- 1 root root 165Feb 2 2020. Wget-hsts

Found that the .bashrc file does not have permission to execute

So the operation is as follows:

Chmod 766 ~ / .bashrcroot @ 0d71811f7c01:/usr/local/src# ls-al ~ / total 32drwx-1 root root 4096 Nov 17 23:34. Drwxr-xr-x 1 root root 4096 Nov 10 14:57.-rw- 1 root root 523 Nov 17 23:34. Bash _ history-rwxrw-rw- 1 root root 666 Nov 1811: 57 .bashrcdrwx-3 root root 4096 Nov 17 15:25 .cache-rw-r--r-- 1 Root root 126 Nov 3 14:57. Gitconfig-rw-r--r-- 1 root root 148Aug 17 2015. Profile-rw-r--r-- 1 root root 165Feb 2 2020. Wget-hsts

So that the .bashrc file has permission to execute.

Because I am an administrator, 766 only gives the administrator the right to execute, if you are not an administrator, you can change to 777 directly, but it is recommended to restore to the original permissions after execution, which is safer.

This is the end of "how to solve the problem of bash:/root/.bashrc:Permission denied". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report