CIFS

article/2025/8/19 23:45:12
一、CIFS
  1.CIFS系统:Internet文件共享系统,也称服务器信;适用于MicrosoftWindows服务器和客户端的标准文件和打印机的共享系统息块(SMB)
  2.Samba服务:用于将linux文件系统作为CIFS/SMB网络文件进行共享,并将linux打印机作为CIFS/SMB打印机进行共享

二、Smb服务
 

 1.安装smb服务


  samba          ##服务端
  samba-common
  samba-client

 2.打开smb,列出共享文件系统信息

[root@localhost ~]# systemctl start smb


[root@localhost ~]# smbclient -L //172.25.254.108


Enter root's password:
Anonymous login successful
Domain=[MYGROUP] OS=[Unix] Server=[Samba 4.1.1]

    Sharename       Type      Comment
    ---------       ----      -------
    IPC$            IPC       IPC Service (Samba Server Version 4.1.1)
Anonymous login successful
Domain=[MYGROUP] OS=[Unix] Server=[Samba 4.1.1]

    Server               Comment
    ---------            -------

    Workgroup            Master
    ---------            -------

 3.设置默认域名  [global]


 89         workgroup = WESTOS


 90         server string = Samba Server Version %v

 4.设置黑白名单  [global]

 96 ;       hosts allow = 172.25.254.8 172.25.254.108

      

 97 ;       hosts deny  = 172.25.254.8 172.25.254.108

      


 5.设置用户登陆  ##注意:必须是本地用户
[root@localhost ~]# useradd tom
[root@localhost ~]# useradd jerry

[root@localhost ~]# smbpasswd -a tom  ##添加tom用户


New SMB password:
Retype new SMB password:
Added user tom.

[root@localhost ~]# smbpasswd -a jerry  ##添加jerry用户


New SMB password:
Retype new SMB password:
Added user jerry.
[root@localhost ~]# pdbedit -L   ##列出smb用户
tom:1001:
jerry:1002:

[root@localhost ~]# pdbedit -x jerry  ##删除jerry用户


[root@localhost ~]# pdbedit -L
tom:1001:

 6.使用用户登陆

[root@localhost ~]# smbclient -L //172.25.254.108 -U tom


Enter tom's password:
Domain=[WESTOS] OS=[Unix] Server=[Samba 4.1.1]

    Sharename       Type      Comment
    ---------       ----      -------
    IPC$            IPC       IPC Service (Samba Server Version 4.1.1)

    tom             Disk      Home Directories




三、Smb的Selinx保护

 当Selinux=Disable时
 1.进入用户家目录编辑

[root@localhost ~]# smbclient //172.25.254.108/tom -U tom


Enter tom's password:
Domain=[WESTOS] OS=[Unix] Server=[Samba 4.1.1]

smb: \> ls  ##列出远程文件


  .                                   D        0  Thu May  3 21:46:28 2018
  ..                                  D        0  Thu May  3 21:46:34 2018
  .bash_profile                       H      193  Wed Jan 29 07:45:18 2014
  .mozilla                           DH        0  Thu Jul 10 18:29:32 2014
  .config                            DH        0  Thu Jul 10 19:06:52 2014
  .bashrc                             H      231  Wed Jan 29 07:45:18 2014
  .bash_logout                        H       18  Wed Jan 29 07:45:18 2014

smb: \> !ls  ##列出本地主机文件
anaconda-ks.cfg  Documents  Music     Public     Videos
Desktop         Downloads  Pictures  Templates

smb: \> put anaconda-ks.cfg  ##上传


putting file anaconda-ks.cfg as \anaconda-ks.cfg (8416.2 kb/s) (average 8417.0 kb/s)

smb: \> rm anaconda-ks.cfg  ##删除



smb: \> ?   ##列出smb可以使用的命令


?              allinfo        altname        archive        backup         
blocksize      cancel         case_sensitive cd             chmod          
chown          close          del            dir            du             
echo           exit           get            getfacl        geteas    

 2.挂载

[root@localhost ~]# mount -o username=tom,password=123 //172.25.254.108/tom /mnt


[root@localhost ~]# df
Filesystem           1K-blocks    Used Available Use% Mounted on
/dev/vda1             10473900 3186240   7287660  31% /
devtmpfs                469344       0    469344   0% /dev
tmpfs                   484932     140    484792   1% /dev/shm
tmpfs                   484932   12828    472104   3% /run
tmpfs                   484932       0    484932   0% /sys/fs/cgroup
/dev/mapper/vg0-vo      483670    2361    451818   1% /home
/dev/sr0               3654720 3654720         0 100% /run/media/root/RHEL-7.0 Server.x86_64

//172.25.254.108/tom    483670    2361    451818   1% /mnt



 3.设置开机自动挂载
[root@localhost ~]# vim /etc/fstab

//172.25.254.108/tom /mnt cifs defaults,username=tom,password=123 0 0



当Selinux=Enforing时  ##注意:smb处于开启状态


samba_enable_home_dirs  ##允许本地主目录作为CIFS文件共享
use_samba_home_dirs     ##允许挂载远程CIFS文件共享并将其用作本地主目录
samba_share_t           ##smb共享目录的selinux安全上下文
samba_export_all_ro     ##共享目录只读
samba_export_all_rw     ##允许共享目录读写

 1.进入用户家目录编辑
[root@localhost ~]# smbclient //172.25.254.108/tom -U tom
Enter tom's password:
Domain=[WESTOS] OS=[Unix] Server=[Samba 4.1.1]
smb: \> ls

NT_STATUS_ACCESS_DENIED listing \*



 2.修改sebool值,进入用户家目录编辑

[root@localhost ~]# setsebool -P samba_enable_home_dirs on


[root@localhost ~]# smbclient //172.25.254.108/tom -U tom
Enter tom's password:
Domain=[WESTOS] OS=[Unix] Server=[Samba 4.1.1]
smb: \> ls
  .                                   D        0  Thu May  3 21:49:51 2018
  ..                                  D        0  Thu May  3 21:46:34 2018
  .bash_profile                       H      193  Wed Jan 29 07:45:18 2014
  .mozilla                           DH        0  Thu Jul 10 18:29:32 2014
  .config                            DH        0  Thu Jul 10 19:06:52 2014
  .bashrc                             H      231  Wed Jan 29 07:45:18 2014
  .bash_logout                        H       18  Wed Jan 29 07:45:18 2014

        60458 blocks of size 8192. 56476 blocks available



 3.共享目录
 用户建立目录:
  修改配置文件,共享tets目录

[root@localhost ~]# mkdir /test


[root@localhost ~]# vim /etc/samba/smb.conf


        [test]
        comment = test directory
        path    =/test
  重启smb,可以看到test目录共享信息
[root@localhost ~]# systemctl restart smb.service
[root@localhost ~]# smbclient -L //172.25.254.108/
Enter root's password:
Anonymous login successful
Domain=[WESTOS] OS=[Unix] Server=[Samba 4.1.1]

    Sharename       Type      Comment
    ---------       ----      -------
    test            Disk      test directory
    IPC$            IPC       IPC Service (Samba Server Version 4.1.1)
  但是,tom用户登陆无法编辑
[root@localhost ~]# smbclient  //172.25.254.108/test -U tom
Enter tom's password:
Domain=[WESTOS] OS=[Unix] Server=[Samba 4.1.1]
smb: \> ls
NT_STATUS_ACCESS_DENIED listing \*
  修改test目录的安全上下文,重启后再次登陆编辑

[root@localhost ~]# semanage fcontext -a -t samba_share_t '/test(/.*)?'


[root@localhost ~]# restorecon -RvvF /test/
restorecon reset /test context unconfined_u:object_r:default_t:s0->system_u:object_r:samba_share_t:s0
[root@localhost ~]# systemctl restart smb.service

[root@localhost ~]# smbclient  //172.25.254.108/test -U tom


Enter tom's password:
Domain=[WESTOS] OS=[Unix] Server=[Samba 4.1.1]
smb: \> ls
  .                                   D        0  Thu May  3 22:48:51 2018
  ..                                  D        0  Thu May  3 22:48:51 2018

系统目录:
  修改配置文件,共享mnt系统目录
[root@localhost ~]# vim /etc/samba/smb.conf
    [mnt]
        comment = mnt test directory

        path    =/mnt


  重启后查看共享目录信息
[root@localhost ~]# systemctl restart smb.service
[root@localhost ~]# smbclient -L //172.25.254.108/
Enter root's password:
Anonymous login successful
Domain=[WESTOS] OS=[Unix] Server=[Samba 4.1.1]

    Sharename       Type      Comment
    ---------       ----      -------
    test            Disk      test directory
    mnt             Disk      mnt test directory

    IPC$            IPC       IPC Service (Samba Server Version 4.1.1)


  设定samba的sebool值,打开所有共享目录的读写权限
[root@localhost ~]# setsebool samba_export_all_rw 1

[root@localhost ~]# smbclient  //172.25.254.108/mnt -U tom


Enter tom's password:
Domain=[WESTOS] OS=[Unix] Server=[Samba 4.1.1]
smb: \> ls
  .                                   D        0  Thu May 11 20:23:52 2017
  ..                                  D        0  Thu May  3 22:48:51 2018

四、多用户挂载

 1.指定用户具备读写权限  
[root@localhost ~]# vim /etc/samba/smb.conf
        [test]
        comment = test directory
        path    =/test
        write list =tom      ##只有tom用户具备权限
        ##writable = yes     ##所有用户具备权限

        ##write list =@tom   ##只有tom组的用户具备权限



 2.设定共享目录的读写权限,重启后测试
[root@localhost ~]# chmod 777 /test/
[root@localhost ~]# systemctl restart smb.service
 只有tom用户具备权限

[root@localhost ~]# mount //172.25.254.108/test /mnt -o username=tom,password=123


[root@localhost ~]# touch /mnt/file1
[root@localhost ~]# rm -rf /mnt/file1
 挂载jerry用户,不具备权限
[root@localhost ~]# umount /mnt
[root@localhost ~]# mount //172.25.254.108/test /mnt -o username=jerry,password=123
[root@localhost ~]# touch /mnt/file2

touch: cannot touch ‘/mnt/file2’: Permission denied



 3.用户相关权限设置
    security = user
        passdb backend = tdbsam

        map to guest = bad user  ##匿名用户映射为guest



        [test]
        comment = test directory
        path    =/test
        writeanle = yes
        browseable = no    ##不显示test共享目录

        guest ok = yes     ##允许匿名用户登陆


        admin users =student  ##studet用户编辑时以root用户身份



 匿名用户登陆

[root@localhost ~]# mount //172.25.254.108/test /mnt -o username=guest


[root@localhost ~]# df
//172.25.254.108/test  10473900 3186684   7287216  31% /mnt

//172.25.254.108/test on /mnt type cifs (rw,relatime,vers=1.0,cache=strict,username=guest,domain=LOCALHOST,uid=0,noforceuid,gid=0,noforcegid,addr=172.25.254.108,unix,posixpaths,serverino,acl,rsize=1048576,wsize=65536,actimeo=1)

 不显示test共享目录,但是不影响使用


Domain=[WESTOS] OS=[Unix] Server=[Samba 4.1.1]

    Sharename       Type      Comment
    ---------       ----      -------
    mnt             Disk      mnt test directory

    IPC$            IPC       IPC Service (Samba Server Version 4.1.1)


 以student身份挂载,建立文件

[root@localhost ~]# mount //172.25.254.108/test /mnt -o username=student,password=123


[root@localhost ~]# touch /mnt/fire00
[root@localhost ~]# ll /mnt
total 0
-rw-r--r--. 1 root student 0 May  4 00:31 fire00

 4.实现多用户挂载
 安装 cifs-utils 软件
 配置用户文件 vim /root/samba
 查看帮助 man mount.cifs
 多用户挂载 mount -o credentials=/root/samba,sec=ntlmssp,multiuer //172.25.254.108/test /mnt
 此时root用户
[root@foundation8 ~]# cd /mnt/
[root@foundation8 mnt]# ls
file  file123  filetest
[root@foundation8 mnt]# rm -fr file123
rm: cannot remove ‘file123’: Permission denied
[root@foundation8 mnt]# touch test
touch: cannot touch ‘test’: Permission denied

 而普通用户
[kiosk@foundation8 yum.repos.d]$ cd /mnt
[kiosk@foundation8 mnt]$ ls
ls: reading directory .: Permission denied

 普通用户认证  ##跟/test权限有关
[kiosk@foundation8 mnt]$ cifscreds add -u tom 172.25.254.108
Password:
[kiosk@foundation8 mnt]$ ls
file  file123  filetest
[kiosk@foundation8 mnt]$ rm -fr file
rm: cannot remove ‘file’: Permission denied
一、CIFS
  1.CIFS系统:Internet文件共享系统,也称服务器信;适用于MicrosoftWindows服务器和客户端的标准文件和打印机的共享系统息块(SMB)
  2.Samba服务:用于将linux文件系统作为CIFS/SMB网络文件进行共享,并将linux打印机作为CIFS/SMB打印机进行共享

二、Smb服务
 
 1.安装smb服务
  samba          ##服务端
  samba-common
  samba-client

 2.打开smb,列出共享文件系统信息
[root@localhost ~]# systemctl start smb
[root@localhost ~]# smbclient -L //172.25.254.108
Enter root's password:
Anonymous login successful
Domain=[MYGROUP] OS=[Unix] Server=[Samba 4.1.1]

    Sharename       Type      Comment
    ---------       ----      -------
    IPC$            IPC       IPC Service (Samba Server Version 4.1.1)
Anonymous login successful
Domain=[MYGROUP] OS=[Unix] Server=[Samba 4.1.1]

    Server               Comment
    ---------            -------

    Workgroup            Master
    ---------            -------

 3.设置默认域名  [global]
 89         workgroup = WESTOS
 90         server string = Samba Server Version %v

 4.设置黑白名单  [global]
 96 ;       hosts allow = 172.25.254.8 172.25.254.108       
 97 ;       hosts deny  = 172.25.254.8 172.25.254.108       

 5.设置用户登陆  ##注意:必须是本地用户
[root@localhost ~]# useradd tom
[root@localhost ~]# useradd jerry
[root@localhost ~]# smbpasswd -a tom  ##添加tom用户
New SMB password:
Retype new SMB password:
Added user tom.
[root@localhost ~]# smbpasswd -a jerry  ##添加jerry用户
New SMB password:
Retype new SMB password:
Added user jerry.
[root@localhost ~]# pdbedit -L   ##列出smb用户
tom:1001:
jerry:1002:
[root@localhost ~]# pdbedit -x jerry  ##删除jerry用户
[root@localhost ~]# pdbedit -L
tom:1001:

 6.使用用户登陆
[root@localhost ~]# smbclient -L //172.25.254.108 -U tom
Enter tom's password:
Domain=[WESTOS] OS=[Unix] Server=[Samba 4.1.1]

    Sharename       Type      Comment
    ---------       ----      -------
    IPC$            IPC       IPC Service (Samba Server Version 4.1.1)
    tom             Disk      Home Directories

三、Smb的Selinx保护

 当Selinux=Disable时
 1.进入用户家目录编辑
[root@localhost ~]# smbclient //172.25.254.108/tom -U tom
Enter tom's password:
Domain=[WESTOS] OS=[Unix] Server=[Samba 4.1.1]
smb: \> ls  ##列出远程文件
  .                                   D        0  Thu May  3 21:46:28 2018
  ..                                  D        0  Thu May  3 21:46:34 2018
  .bash_profile                       H      193  Wed Jan 29 07:45:18 2014
  .mozilla                           DH        0  Thu Jul 10 18:29:32 2014
  .config                            DH        0  Thu Jul 10 19:06:52 2014
  .bashrc                             H      231  Wed Jan 29 07:45:18 2014
  .bash_logout                        H       18  Wed Jan 29 07:45:18 2014

smb: \> !ls  ##列出本地主机文件
anaconda-ks.cfg  Documents  Music     Public     Videos
Desktop         Downloads  Pictures  Templates

smb: \> put anaconda-ks.cfg  ##上传
putting file anaconda-ks.cfg as \anaconda-ks.cfg (8416.2 kb/s) (average 8417.0 kb/s)

smb: \> rm anaconda-ks.cfg  ##删除

smb: \> ?   ##列出smb可以使用的命令
?              allinfo        altname        archive        backup         
blocksize      cancel         case_sensitive cd             chmod          
chown          close          del            dir            du             
echo           exit           get            getfacl        geteas    

 2.挂载
[root@localhost ~]# mount -o username=tom,password=123 //172.25.254.108/tom /mnt
[root@localhost ~]# df
Filesystem           1K-blocks    Used Available Use% Mounted on
/dev/vda1             10473900 3186240   7287660  31% /
devtmpfs                469344       0    469344   0% /dev
tmpfs                   484932     140    484792   1% /dev/shm
tmpfs                   484932   12828    472104   3% /run
tmpfs                   484932       0    484932   0% /sys/fs/cgroup
/dev/mapper/vg0-vo      483670    2361    451818   1% /home
/dev/sr0               3654720 3654720         0 100% /run/media/root/RHEL-7.0 Server.x86_64
//172.25.254.108/tom    483670    2361    451818   1% /mnt

 3.设置开机自动挂载
[root@localhost ~]# vim /etc/fstab
//172.25.254.108/tom /mnt cifs defaults,username=tom,password=123 0 0

当Selinux=Enforing时  ##注意:smb处于开启状态
samba_enable_home_dirs  ##允许本地主目录作为CIFS文件共享
use_samba_home_dirs     ##允许挂载远程CIFS文件共享并将其用作本地主目录
samba_share_t           ##smb共享目录的selinux安全上下文
samba_export_all_ro     ##共享目录只读
samba_export_all_rw     ##允许共享目录读写

 1.进入用户家目录编辑
[root@localhost ~]# smbclient //172.25.254.108/tom -U tom
Enter tom's password:
Domain=[WESTOS] OS=[Unix] Server=[Samba 4.1.1]
smb: \> ls
NT_STATUS_ACCESS_DENIED listing \*

 2.修改sebool值,进入用户家目录编辑
[root@localhost ~]# setsebool -P samba_enable_home_dirs on
[root@localhost ~]# smbclient //172.25.254.108/tom -U tom
Enter tom's password:
Domain=[WESTOS] OS=[Unix] Server=[Samba 4.1.1]
smb: \> ls
  .                                   D        0  Thu May  3 21:49:51 2018
  ..                                  D        0  Thu May  3 21:46:34 2018
  .bash_profile                       H      193  Wed Jan 29 07:45:18 2014
  .mozilla                           DH        0  Thu Jul 10 18:29:32 2014
  .config                            DH        0  Thu Jul 10 19:06:52 2014
  .bashrc                             H      231  Wed Jan 29 07:45:18 2014
  .bash_logout                        H       18  Wed Jan 29 07:45:18 2014

        60458 blocks of size 8192. 56476 blocks available

 3.共享目录
 用户建立目录:
  修改配置文件,共享tets目录
[root@localhost ~]# mkdir /test
[root@localhost ~]# vim /etc/samba/smb.conf
        [test]
        comment = test directory
        path    =/test
  重启smb,可以看到test目录共享信息
[root@localhost ~]# systemctl restart smb.service
[root@localhost ~]# smbclient -L //172.25.254.108/
Enter root's password:
Anonymous login successful
Domain=[WESTOS] OS=[Unix] Server=[Samba 4.1.1]

    Sharename       Type      Co mment
    ---------       ----      -------
    test            Disk      test directory
    IPC$            IPC       IPC Service (Samba Server Version 4.1.1)
  但是,tom用户登陆无法编辑
[root@localhost ~]# smbclient  //172.25.254.108/test -U tom
Enter tom's password:
Domain=[WESTOS] OS=[Unix] Server=[Samba 4.1.1]
smb: \> ls
NT_STATUS_ACCESS_DENIED listing \*
  修改test目录的安全上下文,重启后再次登陆编辑
[root@localhost ~]# semanage fcontext -a -t samba_share_t '/test(/.*)?'
[root@localhost ~]# restorecon -RvvF /test/
restorecon reset /test context unconfined_u:object_r:default_t:s0->system_u:object_r:samba_share_t:s0
[root@localhost ~]# systemctl restart smb.service
[root@localhost ~]# smbclient  //172.25.254.108/test -U tom
Enter tom's password:
Domain=[WESTOS] OS=[Unix] Server=[Samba 4.1.1]
smb: \> ls
  .                                   D        0  Thu May  3 22:48:51 2018
  ..                                  D        0  Thu May  3 22:48:51 2018

系统目录:
  修改配置文件,共享mnt系统目录
[root@localhost ~]# vim /etc/samba/smb.conf
    [mnt]
        comment = mnt test directory
        path    =/mnt
  重启后查看共享目录信息
[root@localhost ~]# systemctl restart smb.service
[root@localhost ~]# smbclient -L //172.25.254.108/
Enter root's password:
Anonymous login successful
Domain=[WESTOS] OS=[Unix] Server=[Samba 4.1.1]

    Sharename       Type      Comment
    ---------       ----      -------
    test            Disk      test directory
    mnt             Disk      mnt test directory
    IPC$            IPC       IPC Service (Samba Server Version 4.1.1)
  设定samba的sebool值,打开所有共享目录的读写权限
[root@localhost ~]# setsebool samba_export_all_rw 1
[root@localhost ~]# smbclient  //172.25.254.108/mnt -U tom
Enter tom's password:
Domain=[WESTOS] OS=[Unix] Server=[Samba 4.1.1]
smb: \> ls
  .                                   D        0  Thu May 11 20:23:52 2017
  ..                                  D        0  Thu May  3 22:48:51 2018

四、多用户挂载

 1.指定用户具备读写权限  
[root@localhost ~]# vim /etc/samba/smb.conf
        [test]
        comment = test directory
        path    =/test
        write list =tom      ##只有tom用户具备权限
        ##writable = yes     ##所有用户具备权限

        ##write list =@tom   ##只有tom组的用户具备权限



 2.设定共享目录的读写权限,重启后测试

[root@localhost ~]# chmod 777 /test/


[root@localhost ~]# systemctl restart smb.service
 只有tom用户具备权限  注意 selinux的权限
[root@localhost ~]# mount //172.25.254.108/test /mnt -o username=tom,password=123
[root@localhost ~]# touch /mnt/file1
[root@localhost ~]# rm -rf /mnt/file1
 挂载jerry用户,不具备权限
[root@localhost ~]# umount /mnt
[root@localhost ~]# mount //172.25.254.108/test /mnt -o username=jerry,password=123
[root@localhost ~]# touch /mnt/file2
touch: cannot touch ‘/mnt/file2’: Permission denied

 3.用户相关权限设置
    security = user
        passdb backend = tdbsam

        map to guest = bad user  ##匿名用户映射为guest



        [test]
        comment = test directory
        path    =/test
        writeanle = yes
        browseable = no    ##不显示test共享目录
        guest ok = yes     ##允许匿名用户登陆

        admin users =student  ##studet用户编辑时以root用户身份



 匿名用户登陆

[root@localhost ~]# mount //172.25.254.108/test /mnt -o username=guest


[root@localhost ~]# df
//172.25.254.108/test  10473900 3186684   7287216  31% /mnt

//172.25.254.108/test on /mnt type cifs (rw,relatime,vers=1.0,cache=strict,username=guest,domain=LOCALHOST,uid=0,noforceuid,gid=0,noforcegid,addr=172.25.254.108,unix,posixpaths,serverino,acl,rsize=1048576,wsize=65536,actimeo=1)

 不显示test共享目录,但是不影响使用
Domain=[WESTOS] OS=[Unix] Server=[Samba 4.1.1]

    Sharename       Type      Comment
    ---------       ----      -------
    mnt             Disk      mnt test directory
    IPC$            IPC       IPC Service (Samba Server Version 4.1.1)
 以student身份挂载,建立文件
[root@localhost ~]# mount //172.25.254.108/test /mnt -o username=student,password=123
[root@localhost ~]# touch /mnt/fire00
[root@localhost ~]# ll /mnt
total 0
-rw-r--r--. 1 root student 0 May  4 00:31 fire00

 4.实现多用户挂载

 安装 cifs-utils 软件


 配置用户文件 vim /root/samba


 查看帮助 man mount.cifs

 多用户挂载 mount -o credentials=/root/samba,sec=ntlmssp,multiuer //172.25.254.108/test /mnt


 此时root用户
[root@foundation8 ~]# cd /mnt/
[root@foundation8 mnt]# ls
file  file123  filetest
[root@foundation8 mnt]# rm -fr file123
rm: cannot remove ‘file123’: Permission denied
[root@foundation8 mnt]# touch test

touch: cannot touch ‘test’: Permission denied



 而普通用户
[kiosk@foundation8 yum.repos.d]$ cd /mnt
[kiosk@foundation8 mnt]$ ls
ls: reading directory .: Permission denied

 普通用户认证  ##跟/test权限有关
[kiosk@foundation8 mnt]$ cifscreds add -u tom 172.25.254.108
Password:
[kiosk@foundation8 mnt]$ ls
file  file123  filetest
[kiosk@foundation8 mnt]$ rm -fr file
rm: cannot remove ‘file’: Permission denied




http://chatgpt.dhexx.cn/article/YVx3FA7J.shtml

相关文章

cifs网络文件系统

搭建实验环境:创建两台虚拟机,确保两台虚拟机的网络互通,给虚拟机1添加大小为10G的硬盘,在虚拟机2中安装samba-client, 1.samba服务简介 smb Server Message Block(Sum公司研发) cifs …

CIFS文件共享

一.基本概念 CIFS 是一个新提出的协议,它使程序可以访问远程Internet计算机上的文件并要求此计算机提供服务。CIFS 使用客户/服务器模式。客户程序请求远在服务器上的服务器程序为它提供服务。服务器获得请求并返回响应。CIFS是公共的或开放的SMB协议版本,并由Microsoft使用…

cifs协议(基于samba服务)

一、基本概念: CIFS是实现文件共享服务的一种文件系统,主要用于实现windows系统中的文件共享,linux系统中用的比较少linux系统中利用CIFS文件系统实现文件共享,需要安装samba服务。它使程序可以访问远程Internet计算机上的文件并要…

hdoj 1570 A C

A C(链接) Problem Description Are you excited when you see the title "AC" ? If the answer is YES , AC it ; You must learn these two combination formulas in the school . If you have forgotten it , see the picture. Now I will…

HDOJ 2005

第几天? Problem Description 给定一个日期,输出这个日期是该年的第几天。 Input 输入数据有多组,每组占一行,数据格式为YYYY/MM/DD组成,具体参见sample input ,另外,可以向你确保所有的输入数据是合法的…

杭电OJ,已重新开放!HDOJ

前几天我们介绍了网络上有很多可以练习上机考试刷题的网站,叫做OJ(Online Judge)。还提到了一些学校已经公布了复试上机的说明,可以提前练习。 已经有211大学发布计算机专业,研究生复试上机考试说明 在其中我们提到&am…

HDOJ学习笔记(一)

原创文章,版权归www.encalyk.com所有,转载请注明。 第一阶段,做了如下训练。 任务一、了解HDOJ系统(acm.hdu.edu.cn),看完F.A.Q,注册Forum账号,熟悉各栏目代表的意思。 任务二、学会…

HDOJ初体验

HDOJ的使用 1.0 什么是HDOJ HDOJ 是“杭州电子科技大学程序在线评测系统”(Hangzhou Dianzi University Online Judge)的缩写,是一个提供编程题目以及在线测评的网站,其兼容Pascal、C、C、Java、GCC、G等多种语言,并拥…

CTFhub—弱密码(web)

CTFhub—弱密码(web) 进入环境—后台登陆界面 浏览其设置代理,burpsuite开启拦截 拦截成功,右键发送给intruder(测试器) add 添加账号密码两个参数,并更改攻击方式为Cluster bomb(第四种) 给账号,密码这两个参数添加需要使用…

使用burp对Tomcat 弱密码爆破

1、环境搭建 使用 Vulhub 在服务器上搭建: cd /vulhub/tomcat/tomcat8 docker-compose up -d12 访问127.0.0.1:8080,进入到 Tomcat 默认界面: 2、漏洞复现 使用弱密码用户名:tomcat,密码:tomcat 进入到…

使用John the ripper破解弱密码

实验目的: 熟练使用John the ripper 破解弱密码 实验环境: 系统:kali CentOs7 kali用户名:kali 密码:kali CentOs7用户名1:root 密码:123456 实验步骤: 第一步&#xff1…

Nignx的修改弱密码套件

目录 1. 各协议对应的密码套件名称: 2. Nmap &Sslscan查询密码套件 3. Nignx修改弱密码套件 1. MD5、DES和CBC_SHA类型修改 2. 限制很多的特定类型密码套件 4. Windows Server系统的协议修改 1. 各协议对应的密码套件名称: 以下列表给出了相关规…

PostgresSQL弱密码导致命令执行

点击"仙网攻城狮”关注我们哦~ 不当想研发的渗透人不是好运维 让我们每天进步一点点 简介 PostgreSQL( 读作 Post-Gres-Q-L)是一个功能非常强大的、源代码开放的客户/服务器关系型数据库管理系统(RDBMS)。 当该服务配置不当开放到外网时可以被暴力破…

MySQL弱密码和webshell

MySQL弱密码和webshell问题文档 一、了解漏洞 1、mysql是什么 MySQL 是最流行的关系型数据库管理系统,在 WEB 应用方面 MySQL 是最好的 RDBMS(Relational Database Management System:关系数据库管理系统)应用软件之一。 关系数据库管理系统(…

通用数据库弱密码检测解决方案

通过加密解密算法检验数据库用户密码是否存在弱密码问题,可适用于主流的数据库产品(Oracle,MySQL,Postgres,SQLServer,达梦8,人大金仓8),解决传统通过碰库方式检测的效率…

使用Hydra破解弱密码

实验目的: 使用kali的Hydra工具破解CtenOs7的密码;. 实验环境: 系统: CentOs7 kali CentOs7用户名1:root 密码:123456 kali用户名:kali 密码&am…

Tomcat 弱密码爆破 漏洞复现

Tomcat 弱密码爆破 漏洞复现 一、漏洞描述二、漏洞影响三、漏洞复现1、环境搭建2、漏洞复现 四、漏洞POC五、参考链接 一、漏洞描述 Tomcat有一个管理后台,其用户名和密码在Tomcat安装目录下的conf\tomcat-users.xml文件中配置,不少管理员为了方便&…

密码套件 and 弱密码套件漏洞

目录 what is 密码套件 (TLS cipher suit) potocol版本 SSL vs TLS key exchange Authentication : Cipher: MAC: 常见密码套件 什么是“弱密码套件”漏洞 what is 密码套件 (TLS cipher suit) 当一个client端browser试图去访问webapp的时候&am…

linux弱密码检测

1.安装一个john软件包用来检测弱密码 2.进入桌面可以看到 3.使用mkdir /soft 在/下创建一个soft的文件夹;然后使用mv命令:mv john-1.8.0.tar.xz /soft/ 把john包移动到soft下面: 4.在soft的文件夹下使用:tar -xf john-1.8.0.tar.xz 解压缩: 5.进入到src目录下: 6.ma…

Tomcat控制台弱密码漏洞

文章目录 一、漏洞介绍1.1 漏洞原理1.2 影响版本1.3 触发条件 二、环境搭建2.1 环境信息2.2 tomcat配置2.3 配置漏洞环境 三、攻击过程3.1 控制台弱密码3.2 冰蝎控制 四、漏洞修复 一、漏洞介绍 1.1 漏洞原理 Tomcat支持后台部署War文件,默认情况下管理页面仅允许本…