8.1作業習題

1,創建testuser uid 1234,主組:bin,輔助組:root,ftp,shell:/bin/csh home:/testdir/testuser

useradd -u 1234 -g bin -G root,ftp -s /bin/csh -d /testdir/testuser testuser

2.修改testuser uid:4321,主組:root,輔助組:nobody,name:test,home:/home/test 家數據遷移

usermod -u 4321 -g root -G nobody -l test -d /home/test -m testuser

3.批量創建帳號:user1…user10

uid:3000-3009,shell:/bin/csh,home:/testdir/username

passwd:usernamepass

注意家目錄相關配置,使用戶正常登錄

vi user.txt

user1:x:3000:3000::/testdir/username:/bin/csh

user2:x:3001:3001::/testdir/username:/bin/csh

user3:x:3002:3002::/testdir/username:/bin/csh

user4:x:3003:3003::/testdir/username:/bin/csh

user5:x:3004:3004::/testdir/username:/bin/csh

user6:x:3005:3005::/testdir/username:/bin/csh

user7:x:3006:3006::/testdir/username:/bin/csh

user8:x:3007:3007::/testdir/username:/bin/csh

user9:x:3008:3008::/testdir/username:/bin/csh

user10:x:3009:3009::/testdir/username:/bin/csh

newusers user.txt

vi p.txt

user1:usernamepass

user2:usernamepass

user3:usernamepass

user3:usernamepass

user4:usernamepass

user5:usernamepass

user6:usernamepass

user7:usernamepass

user8:usernamepass

user9:usernamepass

user10:usernamepass

cat p.txt |chpasswd

cp -r /etc/sk1/.[^.]* /testdir/username/user1

cp -r /etc/sk1/.[^.]* /testdir/username/user2

cp -r /etc/sk1/.[^.]* /testdir/username/user3

cp -r /etc/sk1/.[^.]* /testdir/username/user4

cp -r /etc/sk1/.[^.]* /testdir/username/user5

cp -r /etc/sk1/.[^.]* /testdir/username/user6

cp -r /etc/sk1/.[^.]* /testdir/username/user7

cp -r /etc/sk1/.[^.]* /testdir/username/user8

cp -r /etc/sk1/.[^.]* /testdir/username/user9

cp -r /etc/sk1/.[^.]* /testdir/username/user10

原創文章,作者:swzczx,如若轉載,請注明出處:http://www.www58058.com/28279

(0)
swzczxswzczx
上一篇 2016-08-04 14:40
下一篇 2016-08-04 14:41

相關推薦

  • Keepalive高可用Nginx服務測試

    環境   系統版本:CentOS 7.2  節點1地址:10.1.8.81  節點2地址:10.1.8.83  虛擬IP地址:10.1.8.248 安裝軟件     yum -y install nginx     yum -y …

    Linux干貨 2017-02-16
  • 馬哥教育網絡班21期第10周課程練習

    1、請詳細描述CentOS系統的啟動流程(詳細到每個過程系統做了哪些事情) POST加電自檢—— 根據bios設定,順序查找引導設備—— 讀取引導設備MBR(共512字節,前446為bootloader,后64表示分區信息,后2表示bootloader有效性),加載bootloader程序—— 以grub為例,grub1.0階段將零磁道一扇區加載到內存,gr…

    Linux干貨 2016-10-24
  • Linux程序包管理rpm

    CentOS系統上rpm命令管理程序包: 安裝、卸載、升級、查詢、校驗、數據庫維護  安裝: rpm {-i|–install} [install-options] PACKAGE_FILE … -v: verbose -vv: -h: 以#顯示程序包管理執行進度;每個#表示2%的進度  rpm -ivh PACK…

    Linux干貨 2015-06-21
  • 馬哥教育網絡班第21期+第四周課程作業

    1. 復制/etc/skel目錄為/home/tuser1,要求/home/tuser1及其內部文件的屬組和其它用戶均沒有任何訪問權限。 cp -r /etc/skel /home/tuser1 chmod –R 700 /home/tuser1 2. 編輯/etc/group文件,添加組hadoop。 echo &q…

    Linux干貨 2016-08-01
  • 計劃任務和周期性任務

    linux計劃任務     功能:指定未來的某以特定的時間點執行一次任務     命令:at、bathc     at命令:         選項: &nbsp…

    Linux干貨 2016-09-12
  • DNS 子域授權和高級應用

    DNS 基礎主從部分 http://www.www58058.com/12395 實驗環境:     系統環境:Centos 6.7     關閉SELINUX:setenforce 0 #立即生效   (實際是寬容模式)     配置防火墻:iptables…

    Linux干貨 2016-11-15
欧美性久久久久