linux常见的错误的解决方法:
在日常开发中,尤其是在Linux中进行操作的时候,经常会碰到各种各样的错误。记录一下,熟能生巧,慢慢参透linux的奥秘
1) 在安装ssl证书的时候,发生certbot命令无法使用的情况
解决方案:
使用yum重新进行安装,卸载掉使用pip方式进行安装的软件
1 2 3 4 5 6 7 8 |
|
2)问题. xxx is not in the sudoers file. This incident will be reported.(当想要以 xxx的身份切换到root权限时,使用sudo su命令,并按提示输入 *** 的密码后出现的错误提示)
解决方案
1 2 3 4 5 6 7 8 9 10 11 |
|
2) is not in the sudoers file
解决方案:
1) 切换到root身份 (su: 只是切换到root, 并没有吧root的环境变量传递过去, su - : 将环境变量一起带过去 , 就像root登陆一样 )
1 2 3 4 5 6 |
|
2) 直接将用户添加到wheel用户组中
1 2 3 |
|
3)新增一个用户, 并以组的形式添加到/etc/sudoers中, 最后再添加一个用户到这个组上
1 2 3 4 |
|
3. 使用su切换用户的时候,变成 -bash4.1-$
原因探究:
1)在该用户的家目录下没有相关环境配置文件(.bash_logout .bash_profile, .bashrc )
2) 该用户的家目录与添加的时候的不一致,
解决:
1) 将/etc/skel的用户环境配置文件复制到指定的目录
1 2 |
|
2) 需要进行迁移操作
1 2 3 |
|
4. 创建用户,登陆只显示$ 符号(Ubuntu)
解决: 需要创建用户的使用创建相应的权限与目录
1 |
|
5. -bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8):
解决:vim /etc/environment
1 2 |
|
配置生效:source /etc/environment
6.nginx: [emerg] bind() to 0.0.0.0:443 failed(98:Address already in use)
解决: 强制关闭接口占用进程
1 |
|
7. 腾讯云重置服务之后,使用ssh或者连接工具都无法进行连接
解决:删除无效密钥
1 |
|
8. grep命令提示Binary file jzl_search_stdout.log matches
解决:
1 2 |
|
推荐教程: 《linux教程》
以上是linux常见的错误有哪些的详细内容。更多信息请关注PHP中文网其他相关文章!