第一种: 01假如要改ssh的默认端口(22),那么你只要修改:/etc/ssh/sshd_config中Port 22,这里把22改成自己要设的端口就行了,不过千万别设和现已有的端口相同哦,以防造成未知后果。 02假如要限制ssh登陆的IP,那么可以如下做: 先:修改/etc/hosts.deny,在其中加入sshd:ALL 然后:修改:/etc/hosts.allow,在其中进行如下设置:sshd:192.168.0.241 这样就可以限制只有192.168.0.241的IP通过ssh登陆上LINUX机器了。当然在做为...
by coolcoolrain - Linux文档专区 - 2010-01-12 11:40:04 阅读(1201) 回复(0)
首先修改配置文件 vi /etc/ssh/sshd_config 找到#Port 22一段,这里是标识默认使用22端口,修改为如下: Port 22 Port 50000 然后保存退出 执行/etc/init.d/sshd restart 这样ssh端口将同时工作与22和50000上。 (现在编辑防火墙配置:vi /etc/sysconfig/iptables 启用50000端口。 执行/etc/init.d/iptables restart 这段适用于打开了iptables的用户,我个人不大习惯用这个,所以不用操作此步 ) 现在请使用ssh工具连接50000端口,来...
修改的是 /etc/ssh/sshd_config 文件 [root@linux ~]# vi /etc/ssh/sshd_config # $OpenBSD: sshd_config,v 1.69 2004/05/23 23:59:53 dtucker Exp $ # This is the sshd server system-wide configuration file. See # sshd_config(5) for more information. # This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin # The strategy used for options in the default sshd_config shipped with # Openssh ...
在安装完毕linux,默认的情况下ssh是开放的,容易受到黑客攻击,简单,有效的操作之一就是修改默认端口号 如下列,我们把22修改我2501 就是修改/etc/ssh/sshd_config //注意,容易和ssh_config相混合 步骤一 [root@localhost ssh]# more sshd_config # $OpenBSD: sshd_config,v 1.69 2004/05/23 23:59:53 dtucker Exp $ # This is the sshd server system-wide configuration file. See # sshd_config(5) for more infor...
操作系统linux和Unix都适用: 改/etc/ssh/sshd_config,将里面的Port改为新端口,比如10022,然后 kill -HUP `cat /var/run/sshd.pid` 就行了。 现有连接自己不会断,因为kill -HUP `cat /var/run/sshd.pid` 只是HUP监听的那个,已经建立的连接(不同的 pid)不会断。 然后你在现有账号下面exit,在用新的端口登陆就可以了。 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/70883/showart_72651...
请各位大神帮忙看看这个实验ssh远程登录X窗口系统,运行firefox出现错误如下提示: lyw@lyw-virtual-machine:~$ ssh -X -l liu 192.168.149.132 [email]liu@192.168.149.132[/email]'s password: Welcome to Ubuntu 12.04.2 LTS (GNU/Linux 3.2.0-38-generic-pae i686) * Documentation: https://help.ubuntu.com/ The programs included with the Ubuntu system are free software; the exact distribution terms for each...