linux 之 telnet 权限问题

来源:互联网 发布:调星仪软件下载 编辑:程序博客网 时间:2024/06/06 09:51


权限问题解决:




第一招:
在linux上安装有些东西时会出现 Permission denied 的情况:以下就是解决它的办法之一
编辑/etc/selinux/config,找到这段:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing


把 SELINUX=enforcing 注释掉:#SELINUX=enforcing ,然后新加一行为:
SELINUX=disabled
保存,关闭。
......


编辑/etc/sysconfig/selinux,找到:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing


如果SELINUX已经是 SELINUX=disabled,那么就不用改了,否则就把SELINUX=enforcing 注释掉,新加一行:
SELINUX=disabled
保存,退出。


如果你碰到其他类似提示:
cannot restore segment prot after reloc: Permission denied
哪应该是SELinux的问题,可以考虑把它关闭。
-------------------------------------------------------------------------------------
郁闷的是.我把SELinux关闭后还是不行.于是到google上search.发现这个很有用.
在你保证SElinux 被disable后.还执行下
chcon -t texrel_shlib_t
如: chcon -t texrel_shlib_t /路径/路径/名字.so (这个文件视具体执行文件.)


以上两步.已经解决了很多server的问题了.


-----------------------------------------------------------------第二招


改/etc/ssh/sshd_config把 PermitRootLogin yes就可以了



---------------------------------------后期报错 :

[root@dz_cj etc]# telnet 134.36.17.190
Trying 134.36.17.190...
telnet: connect to address 134.36.17.190: Connection refused
telnet: Unable to connect to remote host: Connection refused


先检查telnet是否安装:

rpm -qa telnet

--  telnet-0.17-25


查看telnet 服务启动: vi /etc/xinetd.d/telnet 

# default: on
# description: The telnet server serves telnet sessions; it uses \
#       unencrypted username/password pairs for authentication.
service telnet 

disable     = no #激活 telnet 服务,no 
bind       = 210.45.160.17 #your ip 
only_from    = 210.45.0.0/16 #只允许 210.45.0.0 ~ 210.45.255.255 这个网段进入 
only_from    = .edu.cn #只有教育网才能进入! 
no_access    = 210.45.160.{115,116} #这两个ip不可登陆 
access_times  = 8:00-12:00 20:00-23:59 # 每天只有这两个时间段开放服务 
...... 

 disable = no 这里必须为 no


安装后:setup  进入命令行界面  在这里查看防火墙和telnet 是否启动  ntsysv 进入命令界面 修改telnet 服务状态

查看都没有问题后,依然报这个错,怀疑是端口没有打开的原因:

测试端口是否打开:

netstat -an | grep 23 :
tcp        0      0 0.0.0.0:38923               0.0.0.0:*                   LISTEN      unix  2      [ ]         STREAM     CONNECTED     1412355832 unix  2      [ ]         STREAM     CONNECTED     1412354688 unix  2      [ ]         DGRAM                    13523  
已经打开

0 0
原创粉丝点击