- Create your user account on the server
- ssh –l root 10.0.3.***
- yes
- linuxlinux
- useradd sgarcia
- passwd sgarcia
- famous2007
- usermod –c 'Sommer R. Garcia' –G wheel sgarcia
- Edit your .bashrc
- exit
- ssh –l sgarcia 10.0.3.***
- famous2007
- vi ~/.bashrc
- "Insert"
- PATH=$PATH:/sbin:/usr/sbin
- "ESC"
- :wq
- Create new group
- exit
- ssh –l sgarcia 10.0.3.***
- famous2007
- sudo groupadd Growers
- Create new directory
- sudo mkdir /'Company Data'/'Plant Farmers'
- sudo mkdir /'Company Data'/'Plant Farmers'
- Give group permissions on a directory
- sudo chgrp Growers /'Company Data'/'Plant Farmers'
- chmod 775 /'Company Data'/'Plant Farmers'
- Crete new user
- sudo useradd tblack
- sudo useradd tblack
- Create password for new user
- sudo passwd tblack
- chum
- Add details to new user
- sudo usermod –c "Tinsi D. Black" –G Growers tblack
- sudo usermod –c "Tinsi D. Black" –G Growers tblack
- Create a symbolic link
- sudo ln –s /'Company Data'/'Plant Farmers' /home/tblack/Work
- sudo ln –s /'Company Data'/'Plant Farmers' /home/tblack/Work
- Create permanent alias for new user
- sudo vi /home/tblack/.bashrc
- "Insert"
- alias goto="cd ~/Work"
- "ESC"
- :wq
- Create folder in new user's home directory
- sudo mkdir /home/tblack/Scripts
- sudo mkdir /home/tblack/Scripts
- Change owner of new directory
- sudo chown tblack /home/tblack/Scripts
- sudo chown tblack /home/tblack/Scripts
- Change group of new directory
- sudo chgrp tblack /home/tblack/Scripts
- sudo chgrp tblack /home/tblack/Scripts
- Edit user's .bashrc with new path
- sudo vi /home/tblack/.bashrc
- "Insert"
- PATH=$PATH:~/Scripts
- "ESC"
- :wq
- Create executable in user's home directory
- sudo vi /home/tblack/thescript
- "Insert"
|
- "ESC"
- :wq
- Change owner of the script
- sudo chown tblack /home/tblack/thescript
- sudo chown tblack /home/tblack/thescript
- Change group of the script
- sudo chgrp tblack /home/tblack/thescript
- sudo chgrp tblack /home/tblack/thescript
- Make the script executable to the owner
- sudo chmod 775 /home/tblack/thescript
- sudo chmod 775 /home/tblack/thescript
- Find a hidden file
- sudo find / -name "answer.log"2>/dev/null
- sudo find / -name "answer.log"2>/dev/null
- Output tail
- sudo tail -1 /lib/udev/devices/Secret/answer.log 1>/~/Found_Tail.txt
- sudo tail -1 /lib/udev/devices/Secret/answer.log 1>/~/Found_Tail.txt
- Output head
- sudo head -2 /lib/udev/devices/Secret/answer.log 1>/~/Found_Head.txt
- sudo head -2 /lib/udev/devices/Secret/answer.log 1>/~/Found_Head.txt
- Output grep
- sudo grep 'this is the line' /lib/udev/devices/Secret/answer.log 1>/~/Found_Grep.txt
- Extra Credit
- cd /~
- vi EXTRA
- "Insert"
|
- "ESC"
- :wq
- sudo mkdir /~/Scripts
- sudo mv /~/EXTRA /~/Scripts
- sudo chmod 775 /~/Scripts/EXTRA
- sudo vi /~/.bashrc
- "Insert"
- PATH=$PATH:/sbin:/usr/sbin:/~/Scripts
- "ESC"
- :wq
- exit
Now log back in as yourself and type the word EXTRA to run the executable file.
Relax. You are done!