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

NFS:
nfs提供文件系统
portmap 提供协议rpc
[root@station230 ~]# /etc/init.d/portmap restart
[root@station230 ~]# /etc/init.d/nfs restart

配置文件:
主包:nfs-utils
[root@station230 ~]# vim /etc/exports

/tmp *(rw,no_root_squash)
[root@station230 nfs]# mount -t nfs 192.168.100.253:/tmp /mnt/nfs/

[root@station230 nfs]# showmount -e 192.168.100.253
Export list for 192.168.100.253:
/tmp *
[root@station230 ~]# showmount -a 192.168.100.253

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

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

修改端口:
[root@station230 .ssh]# 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:
配置文件:
[root@station230 ~]# vim /etc/samba/smb.conf

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

security = share //共享级别

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

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

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

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

添加本地帐户:
[root@station230 samba]# useradd smbuser1

添加smb帐户:
[root@station230 samba]# smbpasswd -a smbuser1
New SMB password:
Retype new SMB password:
Added user smbuser1.

挂载(user级别):
[root@station230 samba]# mount -t cifs -o username=smbuser1 //192.168.1.253/mysamba /mnt/samba1
Password:

[root@station230 samba]# smbclient -L 192.168.1.253
Password:

常用共享属性:
[mysamba]
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的服务
[root@station230 Server]# /etc/init.d/xinetd restart
[root@station230 Server]# vim /etc/xinetd.d/tftp
disable = no
server_args = -s -c /tftpboot

-c 可以上传文件

你可能感兴趣的:(学习笔记)