cmwp39608f 发表于 2016-6-10 12:36:13

尚观第十一天学习笔记ssh ftp

NFS:
nfs提供文件系统
portmap 提供协议rpc
# /etc/init.d/portmap restart
# /etc/init.d/nfs restart

配置文件:
主包:nfs-utils
# vim /etc/exports

/tmp   *(rw,no_root_squash)
# mount -t nfs 192.168.100.253:/tmp/mnt/nfs/

# showmount -e 192.168.100.253
Export list for 192.168.100.253:
/tmp *
# showmount -a 192.168.100.253

ssh:
# /etc/init.d/sshd start
启动 sshd:               [确定]

ssh无密码登录:
# ssh-keygen
# scp id_rsa.pub 192.168.100.3:/root/.ssh/authorized_keys

修改端口:
# vim /etc/ssh/sshd_config

tcp wrapper:
vim /etc/hosts.allow
vim /etc/hosts.deny
sshd:192.168.100.155
sshd:192.168.100.
sshd:192.168.100.0/255.255.255.0
sshd:192.168.100.0/24
sshd:192.168.100.*
sshd:192.168.100.1?,192.168.100.2?

samba:
配置文件:
# vim /etc/samba/smb.conf

74   workgroup = MYGROUP    //工作组
75    server string = Samba Server//描述

security = share//共享级别

289
290 comment = this is mysamba!
291 path = /haha
292 public = yes
293 writable = yes
重启服务:
# /etc/init.d/smb restart

客户端挂载:
# mount -t cifs //192.168.1.253/mysamba /mnt/samba
Password:
# cd /mnt/samba
# ls
a b

user级别(带用户名和密码):
vim /etc/samba/smb.conf
security = user


comment = this is mysamba!
path = /heihei
writable = yes

添加本地帐户:
# useradd smbuser1

添加smb帐户:
# smbpasswd -a smbuser1
New SMB password:
Retype new SMB password:
Added user smbuser1.

挂载(user级别):
# mount -t cifs -o username=smbuser1 //192.168.1.253/mysamba /mnt/samba1
Password:

# smbclient -L 192.168.1.253
Password:

常用共享属性:

comment = this is mysamba!
path = /heihei

public = yes

writable = yes
write list = user1 user2 @grp1 @grp2

read only = yes
read list = user1 user2 @grp1 @grp2

browseable = yes

valid users = user1 user2 @grp1 @grp2

printable = no

tftp:基于xinetd的服务
# /etc/init.d/xinetd restart
# vim /etc/xinetd.d/tftp
disable = no
server_args       = -s -c /tftpboot

-c 可以上传文件
页: [1]
查看完整版本: 尚观第十一天学习笔记ssh ftp