当前位置:网站首页>@@Script implementation of ishell automatic deployment

@@Script implementation of ishell automatic deployment

2022-06-23 19:45:00 51CTO

      In the work , We can prepare the script in advance , When it comes to work , We can save a lot of time , Most of the similar scripts can be modified to use , The following is from Ishell Script for .

      
      
#!/bin/bash
# Scripts are automated lshell Installation and configuration ( Circular statement required ,read-p)
echo "=================== Start checking whether you are a local source or a network source ======================="
aa=`ls /etc/yum.repos.d/ | wc -l`
if [[ $aa == 1 ]]
then
echo " Currently local source "
touch /mnt/sr0
umount /dev/sr0
mount /dev/sr0 /mnt/sr0
else
echo " Currently a network source "
fi
sleep 3
echo "================== The key premise is that you need this package to complete the following operations ============================"
echo "=================== Start decompressing lshell package =================="
tar -zxvf lshell_0.9.18.tar.gz
echo "=================== Get into lshell-0.9.16=================="
cd lshell-0.9.18
echo "=================== Start installing third-party packages =================="
python setup.py install
read -p"================= Start creating custom users =================" user
useradd $user
read -p"================= Add a password to create a custom user ===============" passwd
passwd $passwd
echo "=================== Enter the user file and start to modify the custom path : Change it to '/usr/bin/lshell'=================="
vim /etc/passwd
echo "[sbl]"
echo "allowed :['ls','echo','ll','cat','pwd','less','tail','more']"
echo "home_path : '/sbl'"
echo " a key :( Append at the bottom of the file ) Add everything above and limit the two lines of content to the command that ordinary users can use "
echo "=================== Start to enter the configuration file and add content to the bottom of the file ================="
vim /etc/lshell.conf
echo " Create restricted directories "
mkdir /sbl
echo " Enter the restricted directory to start creating files "
cd /sbl
echo " Start creating file "
touch aa
echo " Write file contents 'HOLLE WORD'"
vim aa
echo " All configurations are switched sbl The user starts testing "
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
原网站

版权声明
本文为[51CTO]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206231833087498.html