1 / 32

实验三

实验三. jingxi@ustc.edu.cn. 实验三. 进行 linux 系统的安全配置 配置 ssh 服务器和客户端,实现加密的 ftp 服务. 进行 linux 系统的安全配置. 熟悉 linux 中的基本命令 Netstat. 进行 linux 系统的安全配置. 从上面可以看出来 21 端口 ftp 如果我们想看关于 ftp 进程打开了哪些文件 , 可以运行命令 lsof – p 1652. 进行 linux 系统的安全配置. 修改文件属性. 进行 linux 系统的安全配置. 查看网络连接命令 : netstat – ant.

drew
Download Presentation

实验三

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 实验三 jingxi@ustc.edu.cn

  2. 实验三 • 进行linux系统的安全配置 • 配置ssh服务器和客户端,实现加密的ftp服务

  3. 进行linux系统的安全配置 • 熟悉linux中的基本命令 • Netstat

  4. 进行linux系统的安全配置 • 从上面可以看出来21端口ftp • 如果我们想看关于ftp进程打开了哪些文件,可以运行命令lsof –p 1652

  5. 进行linux系统的安全配置 • 修改文件属性

  6. 进行linux系统的安全配置 • 查看网络连接命令 :netstat –ant

  7. 进行linux系统的安全配置 • 利用md5文件校验和,检查文件大小,内容等是否更改。

  8. 进行linux系统的安全配置 ls -l 命令可以来显示文件名与特性

  9. 进行linux系统的安全配置 • 1. chmod —改变文件权限设置。 • 2. chgrp —改变文件的分组。 • 3. chown — 改变文件的拥有权。 • 4. Chattr — 设置文件属性

  10. 进行linux系统的安全配置 • chmod abc file • abc分别代表user、group、other的权限 • chmod 777 file • chgrp [群组名称] [档案或目录] • chgrp test test3.txt • 将文件test3.txt的属主改为test

  11. 进行linux系统的安全配置 • chown • chown jessie:users file1.txt • 将档案file1.txt的拥有者设为users群体的使用者jessie

  12. 进行linux系统的安全配置 • 口令安全配置 • 1.禁用帐号 • 在/etc/passwd文件中用户名前加一个“#”,把“#”去掉即可取消限制。 • 2. 删除帐号 • a) 杀死任何属于该用户的进程或打印任务。 • b) 检查用户的起始目录并为任何需要保存的东西制作备份。 • c) 删除用户的起始目录及其内容。 • d) 删除用户的邮件文件(/var/spool/mail)。 • e) 把用户从邮件别名文件中删除(/etc/sendmail/aliases)。

  13. 进行linux系统的安全配置

  14. 进行linux系统的安全配置 • 网络安全配置 过滤: 系统启动服务清理 屏蔽系统对ping请求的反应 屏蔽系统登录显示信息 “/etc/host.conf”文件配置 使用更安全的版本替代(比如ssh2) 采用TCP wrappers 提供更强的访问控制 限制root用户登录的tty设备 防止欺骗: 禁止IP源路径路由 防范“SYN Attack”拒绝服务攻击 配置防火墙加强网络防御

  15. 进行linux系统的安全配置 • /etc/xinetd.d/telnet ---------------------------------------- • service telnet • { • disable = yes • flags = REUSE • socket_type = stream • wait = no • user = root • server = /usr/sbin/in.telnetd • server_args = -h • log_on_failure += USERID

  16. 进行linux系统的安全配置 • 屏蔽系统对ping请求的反应 • echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all • 编辑“host.conf”文件(vi /etc/host.conf) • order bind,hosts • multi on • nospoof on • 屏蔽系统登录显示信息 • 1)编辑“/ect/rc.d/rc.local”文件 • #echo "" > /etc/issue • #echo "$R" >> /etc/issue • #echo "Kernel $(uname -r) on $a $(uname -m)" >> /etc/issue • #cp -f /etc/issue /etc/issue.net • #echo >> /etc/issu • 2)删除“/etc”目录下“issue.net”、“issue”文件

  17. 进行linux系统的安全配置

  18. 进行linux系统的安全配置 • 编辑securetty文件(vi /etc/securetty)象下面一样,注释掉一些行:

  19. 进行linux系统的安全配置 • 禁止IP源路径路由: • # echo 0 /proc/sys/net/ipv4/conf/*/accept_source_route; • 防范“SYN Attack”拒绝服务攻击 • # echo 1 > proc/sys/net/ipv4/tcp_syncookies

  20. 配置ssh服务器和客户端,实现加密的ftp服务 • 配置ssh服务器 • 解压缩ssh包 • 编译: • cd ssh-3.2.9.1 # ./configure • # make ; • make install ; • make clean

  21. 配置ssh服务器和客户端,实现加密的ftp服务 • 启动:cd /usr/local/sbin ./sshd • 如果说端口已被占用,则在配置文件/etc/ssh2/sshd2_config,找到第27行,Port 22 ,把22改成其他的端口就可以了。

  22. 配置ssh服务器和客户端,实现加密的ftp服务

  23. 配置ssh服务器和客户端,实现加密的ftp服务 • 客户端 • WINDOWS下安装的SSH客户端, 双击安装即可。

  24. 配置ssh服务器和客户端,实现加密的ftp服务

  25. 配置ssh服务器和客户端,实现加密的ftp服务 • 利用ftp传输文件 • 使用psftp

  26. 配置ssh服务器和客户端,实现加密的ftp服务

  27. 配置ssh服务器和客户端,实现加密的ftp服务

  28. 配置ssh服务器和客户端,实现加密的ftp服务

  29. 配置ssh服务器和客户端,实现加密的ftp服务

  30. 配置ssh服务器和客户端,实现加密的ftp服务

  31. 配置ssh服务器和客户端,实现加密的ftp服务 • ftp中常用命令 close 关闭 SFTP 连接 quit 结束本次的 SFTP 会话 help [command] 帮助 cd [directory] 改变当前目录 pwd 察看当前目录 lcd [directory] 改变本地目录 lpwd 察看本地当前目录 get [-r] <filename|directory> 从服务器下载一个文件/目录,这个命令不能用通配符,参数 -r 可以递归下载整个目录

  32. 配置ssh服务器和客户端,实现加密的ftp服务 • put [-r] <filename|directory> [dest] 把文件/目录上传到服务器,mget [-r] <filename|directory> 从服务器下载一批文件/目录 • dir [directory] 列目录 • ls 和 dir 一样 • chmod [file|directory] 改变文件的权限,与 Unix 的 chmod 命令类似 • del <filename> 删除文件,要注意的是 del 只能删除文件 • rm 与 del 一样 • mkdir <new-directory-name> 创建一个目录 • rmdir <directory> 删除一个空目录,只有空目录才可以被删除

More Related