在研究Linux安全的时候遇到一个问题,原本打算修改linux直接远程root登陆,修改为sshd的配置文件后

Nano /etc/ssh/sshd_config
把#PermitRootLogin yes
修改为PermitRootLogin no
修改完成后,保存退出
重启sshd service sshd restart

新建一个普通用户

Useradd unixbar Passwd unixbar

在securecrt远程工具中,使用普通用户登陆的时候,出现了

The server has disconnected with an error. Server message reads: A protocol error occurred. Change of username or service not allowed: (shang1,ssh-connection) -> (shang,ssh-connection)

这样类似的错误。

这是由于securecrt设置的原因导致的。把你的用户名改成unixbar。就可以了,这样做了以后就可以实现禁止root远程登陆:

禁止root远程登录 sshd问题:A protocol error occurred. Change of username or service not allowed的更多相关文章

  1. A protocol error occurred. Change of username or service not allowed: (root,ssh-connection) -> (zoujiaqing,ssh-connection)

    SecureCRT ssh 客户端连接失败: The server has disconnected with an error.  Server message reads: A protocol ...

  2. aix 禁止root远程登录

    Aix禁止root远程登录 aix用户扩展信息大都在/etc/security/user这个文本文件里.你可以修改: login=false 用户不能登录系统 rlogin=false 用户不能从远程 ...

  3. 禁止root远程登录

    Linux禁止root远程登录 ssh的修改vi /etc/ssh/sshd_config将默认的#PermitRootLogin yes去注释改为PermitRootLogin no service ...

  4. linux下禁止root远程登录和添加新用户

    https://www.cnblogs.com/jianz/p/7979250.html 一.添加和root权限一样的用户 1. adduser admin passwd  admin (修改密码) ...

  5. linux下禁止root远程登录

    一.添加和root权限一样的用户 1. adduser admin passwd  admin (修改密码) 2.修改 /etc/sudoers 文件,找到下面一行,在root下面添加一行,如下所示 ...

  6. Linux禁止root远程登录及修改默认端口

    1.1 修改SSHD配置,禁止root远程登录 禁止登录之前先穿甲一个可以远程登录的普通用户,以免造成登录不了的情况 [root@jhkj66 ~]# useradd yw001 #创建用户 [roo ...

  7. Linux生成ssh密钥免密登录,允许/禁止密码登录,允许/禁止root远程登录,更改ssh端口

    进入想要使用密钥登录的用户家目录 cd 或 cd ~ 执行密钥创建命令,不行可能需要下载openssh-server与openssh-client ssh-keygen -t rsa -P " ...

  8. centos6.5 ssh安全优化,修改默认端口名,禁止root远程登录

    一.修改默认端口号 第一步: vi /etc/sysconfig/iptables 添加修改后的端口号的配置 -A INPUT -p tcp -m state --state NEW -m tcp - ...

  9. 解除Ubuntu禁止root远程登录

    编辑SSH服务配置文件 编辑SSH服务的配置文件sshd_config,修改SSH的端口和root用户权限. 使用到的命令:(按字母 i 进入编辑模式,按ESC退出编辑模式, :wq 保存退出). r ...

随机推荐

  1. HDU 1564 Play a game

    Description New Year is Coming! ailyanlu is very happy today! and he is playing a chessboard game wi ...

  2. C socket指南

    1.介绍 Socket 编程让你沮丧吗?从man pages中很难得到有用的信息吗?你想跟上时代去编Internet相关的程序,但是为你在调用 connect() 前的bind() 的结构而不知所措? ...

  3. Java IO 文件与流基础

    Java IO 文件与流基础 @author ixenos 摘要:创建文件.文件过滤.流分类.流结构.常见流.文件流.字节数组流(缓冲区) 如何创建一个文件 #当我们调用File类的构造器时,仅仅是在 ...

  4. .Net使用JsonSchema验证Json

    最近项目中遇到了这样的需求,需要对上传的Json进行验证,以确保Json数据的准确性.前后使用了两种方式来验证: (1)第一种方式的实现思想:根据Json数据的格式,严格定义相应的类结构,并在Syst ...

  5. ubuntu 修改root密码

    重新安装过ubuntu 14.04后,切换到root权限,需要输入密码,输入n次都不对. 也没有记得设置过密码. 百度一下,得到方法如下,已经验证测试成功. 命令为: sudo passwd 提示输入 ...

  6. jQuery执行进度提示窗口的实现(progressbar)

    使用jQuery原生插件,先看效果: 主要是progressbar的更新进度以及“请稍等”后省略号.倒计时关闭的效果 如果执行单个任务的时间较长,会导致浏览器假死,一定要使用异步,代码结构要稍作调整. ...

  7. LeetCode OJ 122. Best Time to Buy and Sell Stock II

    Say you have an array for which the ith element is the price of a given stock on day i. Design an al ...

  8. Excel教程(12) - 数学和三角函数

    ABS     用途:返回某一参数的绝对值.   语法:ABS(number) 参数:number 是需要计算其绝对值的一个实数. 实例:如果 A1=-16,则公式"=ABS(A1)&quo ...

  9. poj 1142 Smith Numbers

    Description While skimming his phone directory in 1982, Albert Wilansky, a mathematician of Lehigh U ...

  10. linux 非root用户 ssh 免密码登录

    之所以要把这个记录下来 是因为它的确和root用户不一样root用户 不需要改动什么权限问题  只要生成私钥/公钥对 即可 但是一样的操作在普通用户上就出了问题了 折腾了老半天 ssh-keygen ...