zoukankan      html  css  js  c++  java
  • 远程ssh登陆时报错:/bin/bash: Permission denied

    远程普通用户ssh登录时,提示/bin/bash: Permission denied,用户名mas,密码正确。

    首先上个图,用户远程登录步骤,转自http://www.tldp.org/LDP/LG/issue52/okopnik.html

                                                               ' ' ' ' ' ' ' '
                               ------------                    '   GIF2ASCII   '
                              |   Start    |                   ' conversion by '
                               ------------                    ' "fastfingers" '
                                    V                          '    program    ' 
                           -------------------                 ' Copyleft 2000 '
               ___________| init: fork + exec |_______          ' ' ' ' ' ' ' '
              |           | "/sbin/getty"     |       |
              |            -------------------        |
              ^                     V                 ^
              |          ----------------------       |
              |         | getty: wait for user |      |
              |          ----------------------       |
              ^                     V                 ^
              |         ----------------------        |
              |        | getty: read username,|       |
              |        | exec "/bin/login"    |       |
              |         ----------------------        |
              ^                     V                 ^
              |         ----------------------        |
              |        | login: read password |       |
              |         ----------------------        |
              ^    	                V                 ^
        	  |    	               /                 |
              |                   /                  |
         -------------           /  Do               |
        | Login: exit |---<-No- /  they              |
         -------------           match?/             ^
                                      /              |
                                     /               |
                                    /                |
                                    | Yes             ^
                                    V                 |
                        ------------------------      |
                       | login: exec("/bin/sh") |     |
                        ------------------------      ^
                                    V                 |
                         ----------------------       |
                        | sh: read and execute |      |
                        | commands             |      ^
                         ----------------------       |
                                    V                 |
                                ----------            |
                               | sh: exit |-----------
                                ----------
    1、登陆后要执行shell,我们检查一下用户登陆后需要使用的shell
    cat /etc/passwd
    。。。
    mas:x:1000:1000:mas:/home/mas:/bin/bash 
    确认登陆后shell是bin/bash
    2、查看文件夹访问权限
    lrwxrwxrwx.   1 root root    7 7月  28 15:23 bin -> usr/bin
    bin具有可执行权限
    3、在bin目录下检查bash权限
    -rwxr-xr-x. 1 cmp cmp 960376 11月 20 2015 bash
    权限没有问题
    4、诊断好久,注意到bin是个链接,实际文件夹是usr,我们看看usr权限
    drwxrw----.  17 cmp  cmp  4096 8月   1 20:41 usr
    其他人缺少执行权限
    chmod 755 /usr
    5、重新远程登陆成功。
  • 相关阅读:
    VMware Workstation的三种网络连接方式
    sql:unix下的sql操作
    linux脚本: makefile以及链接库
    unix shell: ksh fundamental(Korn Shell)
    linux c: core dump
    linux命令:scp
    Eclipse更改默认工作目录的方法
    linux: 可重入函数与不可重入函数
    linux环境 :Linux 共享库LIBRARY_PATH, LD_LIBRARY_PATH 与ld.so.conf
    linux命令:Linux命令大全
  • 原文地址:https://www.cnblogs.com/iHqq/p/5760693.html
Copyright © 2011-2022 走看看