1.vi /etc/ssh/sshd_config,将PermitRootLogin的值改成yes,并保存 PermitRootLogin yes 另外需要添加 AllowUsers root SA 才可以用root进行远程登录 2.service sshd restart进行重启后就可以远程登录啦 vi /etc/ssh/sshd_config,将PermitRootLogin的值改成no,并保存,root就不可以远程登录啦…
https://www.cnblogs.com/jianz/p/7979250.html 一.添加和root权限一样的用户 1. adduser admin passwd  admin (修改密码) 然后输入密码   (密码简单了通不过) 系统提示输入确认密码后再输入一次.OK添加成功. 2.修改 /etc/sudoers 文件,找到下面一行,在root下面添加一行,如下所示: vim /etc/sudoers ## Allow root to run any commands anywhere…
一.添加和root权限一样的用户 1. adduser admin passwd  admin (修改密码) 2.修改 /etc/sudoers 文件,找到下面一行,在root下面添加一行,如下所示 vim /etc/sudoers  ## Allow root to run any commands anywhere root ALL=(ALL) ALL admin ALL=(ALL) ALL 二.禁止root远程登录 需要编辑/etc/ssh/sshd_config. vim /etc/ss…
进入想要使用密钥登录的用户家目录 cd 或 cd ~ 执行密钥创建命令,不行可能需要下载openssh-server与openssh-client ssh-keygen -t rsa -P "" 回车 将公钥文件内容拷贝到authorized_keys cd .ssh/ cat id_rsa.pub >> authorized_keys chmod 600 authorized_keys 将密钥文件id_rsa留作登录,在xshell上登录时使用密钥登录,浏览-->用…
1.1 修改SSHD配置,禁止root远程登录 禁止登录之前先穿甲一个可以远程登录的普通用户,以免造成登录不了的情况 [root@jhkj66 ~]# useradd yw001 #创建用户 [root@jhkj66 ~]# passwd yw001 #设置密码 Changing password for user yw001. New password: #输入你的密码 Retype new password: #确认密码 passwd: all authentication tokens u…
Linux禁止root远程登录 ssh的修改vi /etc/ssh/sshd_config将默认的#PermitRootLogin yes去注释改为PermitRootLogin no service sshd restart; 来自为知笔记(Wiz)…
Aix禁止root远程登录 aix用户扩展信息大都在/etc/security/user这个文本文件里.你可以修改: login=false 用户不能登录系统 rlogin=false 用户不能从远程登录系统 su=false     其他用户不能切换到该用户 如果有特殊需要,干脆使用smitty lockuser锁定指定用户即可 禁止telnet登录 smit chuser ->root ->User can login REMOTELY(rsh,tn,rlogin) =false 禁止ss…
一.修改默认端口号 第一步: vi /etc/sysconfig/iptables 添加修改后的端口号的配置 -A INPUT -p tcp -m state --state NEW -m tcp --dport 22001 -j ACCEPT 本例中,使用22001端口 添加后保存配置并重启防火墙. service iptables save (保存防火墙配置)  ----此处貌似有问题,运行这个以后又恢复到修改前了.这个先不使用.service iptables restart (重启防火墙…
在研究Linux安全的时候遇到一个问题,原本打算修改linux直接远程root登陆,修改为sshd的配置文件后 Nano /etc/ssh/sshd_config 把#PermitRootLogin yes 修改为PermitRootLogin no 修改完成后,保存退出 重启sshd service sshd restart 新建一个普通用户 Useradd unixbar Passwd unixbar 在securecrt远程工具中,使用普通用户登陆的时候,出现了 The server ha…
编辑SSH服务配置文件 编辑SSH服务的配置文件sshd_config,修改SSH的端口和root用户权限. 使用到的命令:(按字母 i 进入编辑模式,按ESC退出编辑模式, :wq 保存退出). root@Jaking:~# vim /etc/ssh/sshd_config 1. 开放远程端口 找到 # port 22所在的那一行,复制该行内容并修改. 将 #port 22 修改为 port 22(将前面的 # 去掉). 该行内容为设置SSHD服务的端口号 2. 允许root远程登录 找到 #…