远程普通用户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、重新远程登陆成功。

远程ssh登陆时报错:/bin/bash: Permission denied的更多相关文章

  1. su: /bin/bash: Permission denied

    https://bbs.archlinux.org/viewtopic.php?id=105541 New user created as: groupadd mygroupuseradd -s /b ...

  2. su: /bin/bash: Permission denied带来的疑惑

    >客户一个oracle突然当机了,由于业务启动,客户下意识的重启了服务器,系统是起来了,准备切换到oracle用户下启动数据库,可以怎么都无法su切换,真是火上浇油呀,描述如下: 在root用户 ...

  3. 创建新用户后无法切换 su: failed to execute /bin/bash: Permission denied

    创建新用户后无法切换 su: failed to execute /bin/bash: Permission denied   当使用 su username 从root切换用户时显示 su: fai ...

  4. SSH登陆阿里云服务器出现Permission denied (publickey)错误解决方案

    操作环境: 操作系统:Mac10.11.5 阿里云服务器:Ubuntu16.04 远程连接:SSH 注:首先我们已假设你已经自己生成了SSH秘钥,并已经配置到阿里云.绑定了自己的云服务器. 但是后来发 ...

  5. su - oracle /bin/bash: Permission denied

     1) 以root身份执行 stat /  命令 查看权限是否正确 2) chmod 755 / 3) chmod 755 /bin/bash

  6. /bin/ls: Permission denied

    [root@test_node1 ~]# crontab -lno crontab for root[root@test_node1 ~]# cd /home/[root@test_node1 hom ...

  7. Centos7 JDK安装过程中 解决java -version 报错: bash: /home/jdk1.8.0_161/bin/java: Permission denied

    1.执行Linux命令 -----vim /etc/profile  编辑profile  文件,在里面添加: #set java enviroment JAVA_HOME=/opt/JavaHome ...

  8. Centos 7 JDK验证 解决java -version 报错: bash: /home/jdk1.8.0_161/bin/java: Permission denied

    2.vim /etc/profile  编辑profile  文件,在里面添加: #set java enviroment JAVA_HOME=/usr/java/jdk1.8.0_144 JRE_H ...

  9. SQLServer2012在登录远程服务器实例时报错:尝试读取或写入受保护的内存

    SQLServer2012在登录远程服务器实例时报错:尝试读取或写入受保护的内存.这通常指示其它内存已损坏.(System.Data). 而登录本地数据库实例则能顺利登入,不存在上述问题. 试一试重置 ...

随机推荐

  1. sql server 中隐藏掉无关数据库

    先贴上我实际测试的效果 方法一: Problem I have a SQL Server instance that has hundreds of databases.  Navigating th ...

  2. [转]如何循序渐进向dotnet架构师发展

    微软的DotNet开发绝对是属于那种入门容易提高难的技术.而要能够成为DotNet架构师没有三年或更长时间的编码积累基本上是不可能的.特别是在大 型软件项目中,架构师是项目核心成员,承上启下,因此RU ...

  3. KMP算法实现

    链接:http://blog.csdn.net/joylnwang/article/details/6778316 KMP算法是一种很经典的字符串匹配算法,链接中的讲解已经是很明确得了,自己按照其讲解 ...

  4. 2016总结&2017计划

    2016总结 总体而言,上半年比较勤快,下半年偷懒了.下半年仔细看了Barfoot的书<state estimation for robotics>,收获很大. 2017计划 目前打算写以 ...

  5. podfile The dependency `` is not used in any concrete target

    内容提要: podfile升级之后到最新版本,pod里的内容必须明确指出所用第三方库的target,否则会出现The dependency `` is not used in any concrete ...

  6. BZOJ 4726: [POI2017]Sabota?

    4726: [POI2017]Sabota? Time Limit: 20 Sec  Memory Limit: 128 MBSec  Special JudgeSubmit: 301  Solved ...

  7. 【codeforces 148D】 Bag of mice

    http://codeforces.com/problemset/problem/148/D (题目链接) 题意 包中有w个白鼠,b个黑鼠.公主和龙轮流画老鼠,公主先画,谁先画到白鼠谁就赢.龙每画完一 ...

  8. Codeforces Round #384 (Div. 2) B. Chloe and the sequence(规律题)

    传送门 Description Chloe, the same as Vladik, is a competitive programmer. She didn't have any problems ...

  9. Html中<font>标签的使用

    Html中<font>标签的使用 <!doctype html> <html lang="en"> <head> <meta ...

  10. CentOS / Redhat : Configure CentOS as a Software Router with two interfaces

    CentOS / Redhat : Configure CentOS as a Software Router with two interfaces   Linux can be easily co ...