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、重新远程登陆成功。
  • 相关阅读:
    java操作生成jar包 和写入jar包
    jboss配置jndi连接池
    windows 域的LDAP查询相关举例
    LDAP error Code 及解决方法
    HDU 6417
    CF1299D Around the World
    codechef Chef and The Colored Grid
    Educational Codeforces Round 82 (Rated for Div. 2)
    CF1237F Balanced Domino Placements
    CF1254E Send Tree to Charlie
  • 原文地址:https://www.cnblogs.com/iHqq/p/5760693.html
Copyright © 2011-2022 走看看