Centos开启telnet/ssh/ftp/sftp服务
Telnet
开启telnet服务步骤:
1. 查看CentOS/Telnet_server版本:#cat /etc/issue, #rpm -qa | grep telnet
2. 安装服务:# yum install telnet-server
3. 查看安装结果:#rpm –qa | grep telnet
4. 启动telnet服务:vi /etc/xinetd.d/telnet,把其中 disable =yes修改为disable= no
5. 允许root登录,修改/etc/pam.d/remote,注释掉:auth required pam_securetty.so
6. 重启telnet:service xinetd restart
SSH
SSH
1. 由于SSH默认安装服务,且打开了服务:#service sshd start
让root用户能够SSH登陆
默认是不允许root用户登录SSH的,如果登陆结果就会如下:
用PuTTY登陆时,总提示:
login as: root
Using keyboard-interactive authentication.
Password:
Access denied
这个时候需要编辑其配置文件,输入以下命令进行修改:
vim /etc/ssh/sshd_config
然后进行修改. 找到
#PasswordAuthentication no
修改为:
PasswordAuthentication yes
这段的意思是,让SSH使用密码验证登陆.
找到
#PermitRootLogin no
修改为
PermitRootLogin yes
这段的意思是,让SSH准许root用户登录.一般来说,为了安全起见,这一段还是不要允许的好.不过安全要求不高,可以这样做.
找到
#PermitEmptyPasswords no
修改为
PermitEmptyPasswords no
这段的意思是,使得允许空密码成为不可用,换句话说就是,不允许空密码登陆.
检查是否在/etc/inetd.conf 中打开了,请把它注释掉:
#ssh stream tcp nowait root /usr/sbin/sshd sshd -i -4
改成
#ssh stream tcp nowait root /usr/sbin/sshd sshd -i -4
保存、重启
#
/etc/inetd restart
这样就root用户就可以用SSH客户端远程登陆FreeBSD了.
需 要注意的是,在/etc/ssh下面有两个配置文件:/etc/ssh/sshd_config和/etc/ssh/ssh_config,我们需要修改
的是/etc/ssh/sshd_config,我最开始就弄错了--!修改到了/etc/ssh/ssh_config去了,结果咋都不对,寒.
FTP服务
1. 开启FTP服务步骤:
2. 安装FTP服务包:#yum -y install vsftpd
3. 设置开机启动vsftpd ftp服务:# chkconfig vsftpd on
4. 开启FTP服务:# service vsftpd restart PS:需关闭selinux (setenforce 0)
SFTP服务
- #ssh –V 来查看openssh的版本,如果低于4.8p1,需要自行升级安装,
- 创建sftp组:#groupadd sftp
- 创建测试账户:#useradd -g sftp -s /bin/false testuser 修改密码:# passwd testuser
- 创建目录:#mkdir /opt/sftp #cd /opt/sftp; #mkdir testuser
- 修改测试账户HOME路径:# usermod -d /opt/sftp/testuser testuser
- 配置sshd_config :# vim /etc/ssh/sshd_config
- 注释掉:Subsystem sftp /usr/libexec/openssh/sftp-server
- 添加如下几行
- Subsystem sftp internal-sftp
- Match Group sftp
- ChrootDirectory /opt/sftp/%u
- ForceCommand internal-sftp
- AllowTcpForwarding no
- X11Forwarding no
- 设定Chroot目录权限:chown root:sftp /opt/sftp/testuser #chmod 755 /opt/sftp/testuser
- # mkdir /opt/sftp/testuser/upload
- # chown uplus:sftp /opt/sftp/testuser/upload
- # chmod 755 /opt/sftp/testuser/upload
- 重启sshd服务:# service sshd restart
Centos开启telnet/ssh/ftp/sftp服务的更多相关文章
- Linux SSH和SFTP服务分离
Linux SSH和SFTP服务分离 学习了:https://www.cnblogs.com/zihanxing/articles/5665383.html 都是监听22端口:
- CentOS开启telnet服务
原文地址:https://blog.csdn.net/zhujiangm/article/details/4540778 服务器:CentOS-5.1(192.168.1.87)客户机:FC6(192 ...
- Different between Telnet/SSH/FTP
http://www.differencebetween.net/category/technology/protocols-formats/ Telnet vs SSH Secure Shell, ...
- CentOS开启telnet连接
开启telnet连接通道 yum安装telnet yum -y install telnet-server* 关闭防火墙 /etc/init.d/iptables stop 编辑配置文件 vim /e ...
- Ubuntu 开启telnet、ftp服务
Telnet 这里我们就来对Ubuntu Linux telnet的安装设置进行一下讲解. 1. sudo apt-get install xinetd telnetd 2. Ubuntu Linux ...
- Linux 7.5 SSH服务和SFTP服务分离
SFTP是SSH的一部分,SFTP没有单独的守护进程,它必须使用SSHD守护进程(端口号默认是22)来完成相应的连接操作,所以从某种意义上来说,SFTP并不像是一个服务器程序,而更像是一个客户端程序. ...
- Linux之sftp服务
Linux之sftp服务 一.sftp介绍转自:[1]Linux如何开启SFTP https://www.cnblogs.com/xuliangxing/p/7120205.htmlSFTP是Secu ...
- centos linux系统日常管理3 服务管理ntsysv,chkconfig,系统日志rsyslog,last ,lastb ,exec,xargs,dmesg,screen,nohup,curl,ping ,telnet,traceroute ,dig ,nc,nmap,host,nethogs 第十六节课
centos linux系统日常管理3 服务管理ntsysv,chkconfig,系统日志rsyslog,last ,lastb ,exec,xargs,dmesg,screen,nohup,cur ...
- Debian 8开启sftp服务
看到某云的CDN居然是使用ftp这种早该淘汰的协议,不禁有些吐槽.ftp曾经作为互联网上最重要的协议,但漫长使用过程中体现出的各种缺点,已不适合再使用.其中最致命的问题就是明文传输用户密码.建议使用这 ...
随机推荐
- apche安装教程
从Apache官网下载windows安装版的Apache服务器了, 现在分享给大家. 1 进入apache服务器官网http://httpd.apache.org/,这里我们以下载稳定版的 htt ...
- Docker dubbo 服务注册
vim run.sh #!/bin/baship=`ifconfig eth0 |grep "inet"|awk '{print $2}'`hn=dubbo-service-pro ...
- 让你快速上手Runtime(转)
前言 本篇主要介绍Runtime在开发中的一些使用场景,顺便讲解了下MJExtension的底层实现.如果喜欢我的文章,可以关注我微博:袁峥Seemygo,也可以来小码哥,了解下我们的iOS培训课程. ...
- python内置方法补充all
all(iterable) 版本:该函数在python2.5版本首次出现,适用于2.5以上版本,包括python3,兼容python3版本. 说明:如果iterable的所有元素不为0.''.Fals ...
- 20145210姚思羽《网络对抗》——shellcode注入& Return-to-libc攻击深入
20145210姚思羽<网络对抗>shellcode注入&Return-to-libc攻击深入 shellcode基础知识 Shellcode是一段代码,作为数据发送给受攻击服务器 ...
- 修改push动画的方向
CATransition *animation = [CATransition animation]; animation.duration = 0.4; animation.timingFuncti ...
- SiteServer CMS 5.0 源码入门
开发者中心 STL 语言 文 档 博 客 论 坛 Github 二次开发 提示:文档中心正在完善中,我们将不断发布新文档,敬请期待... 新手入门 SiteServer CMS 能做什么 Site ...
- 学习HTML5
CSS,层叠样式表,能为网页增添样式的电脑语言. UL属于无序列表 OL属于有序列表 DL属于自定义列表.
- ES查看segment大小
摘自:http://www.aboutyun.com/thread-17078-1-1.html Segment Memory Segment不是file吗?segment memory又是什么?前面 ...
- Struts2 第一个入门小案例
1.加载类库 2 配置web.xml文件 3.开发视图层 4.开发控制层Action 5.配置struts.xml 6.部署运行