centos下ssh登陆端口修改

数字拓荒客
• 阅读 2172

修改 /etc/ssh/sshd_config ,在 Port 22 下添加你的端口,并把 Port 22 注释掉

vim /etc/ssh/sshd_config

改为

#Port 22
Port YOUR_PORT

重启ssh

service sshd restart

允许特定端口通过

iptables -I INPUT -p tcp --dport YOUR_PORT -j ACCEPT
service iptables save
service iptables restart

完工

点赞
收藏
评论区
推荐文章
Easter79 Easter79
4年前
ssh详解
1.ssh的基本操作打开ssh:SystemAdministrationService找到sshd选择Enable然后start打开SystemAdministrationFirewall将火墙限制关闭ssh配置文件/etc/ssh/sshd\_config将“PasswordAuthenticationyes”改为
Easter79 Easter79
4年前
sshd_config注释
1root@H0f~cat/etc/ssh/sshd_config2updatebyH0f201803133$OpenBSD:sshd_config,v1.802008/07/0202:24:18djmExp$45Thisis
Stella981 Stella981
4年前
SecureCRT 用ssh key登录配置方法
服务器端配置 OS:Debian6.0.5 复制代码代码如下:aptgetinstallssh安装ssh服务编辑/etc/ssh/sshd\_config配置文件 复制代码代码如下:Port3322修改端口为3322(自定义) PermitRo
Stella981 Stella981
4年前
Linux修改SSH默认端口
本文以centos系统为例:1、关闭防火墙和selinux关闭防火墙centos7systemctlstopfirewalldcentos6serviceiptablesstop关闭selinuxvi/etc/selinux/config
Stella981 Stella981
4年前
Fedora开启SSH服务
1)安装opensshserveryuminstallopensshserver 2)查看是否已成功安装opensshserverrpmqa|grepopensshserver 3)修改ssh服务的配置文件   配置ssh服务的运行参数,是通过修改配置文件/etc/ssh/ssh\
Stella981 Stella981
4年前
CentOS配置无密码登录
配置sshd服务在服务器上修改/etc/ssh/sshd\_config:\<!lang:shell禁止root登录PermitRootLoginno指定可以登录的用户AllowUsersbobaliceStrictModesyes
Wesley13 Wesley13
4年前
K8S
准备主机1.centos7镜像2.node1:192.168.0.1013.node2:192.168.0.1024.node3:192.168.0.1035.vip:192.168.0.104配置ssh免密 并修改/etc/hosts跟/etc/hostname配置所
Wesley13 Wesley13
4年前
ubuntu 使用root用户登录
修改配置文件sudovim/etc/ssh/sshd_config找到下面相关配置:Authentication:LoginGraceTime120PermitRootLoginprohibitpasswordStrictModesyes更改为:Aut
Wesley13 Wesley13
4年前
ubuntu下apache2使用的简单总结
一.修改apache2原80端口为90端口1\.修改/etc/apache2/ports.conf,将端口80改为90,443,改为4442\.修改/etc/apache2/sitesenabled/000default,将<virtualHost\:80修改为903\.重启serviceapache2restart
Stella981 Stella981
4年前
RHEL 7修改ssh默认端口号
RHEL7修改默认端口号(默认port22)初次安装系统完毕后默认情况下系统已经启动了sshd服务当然我们也可以先进行检查:步骤1,检查是否已安装ssh服务!(https://oscimg.oschina.net/oscnet/f5cdebe3f8b0ef387d120023012de645f0a.jpg)步骤2,
胖大海 胖大海
3年前
Debian 启用root账户远程登录并删除多余用户
1开启远程登录执行下方命令后开启root用户的远程登录sudoecho"Port22"/etc/ssh/sshdconfig sudoecho"PermitRootLoginyes"/etc/ssh/sshdconfig sudoservicesshdrestart2删除多余登陆用户删除用户deluser 用户名删除用户及