Web Dev Owner Tool
Page 1 of 1
Web Dev Owner Tool
Web Dev Owner Tool (c)J~~Net 2021
This will search for files in web directory owned by a user of your choice and change ownership to another user of your choice!
own.sh
Now edit the file for your needs
Make executable
Run
This will search for files in web directory owned by a user of your choice and change ownership to another user of your choice!
own.sh
- Code:
#!/bin/bash
# (c) J~Net 2021
# jnet.sytes.ent
#
# https://jnet.forumotion.com/t1749-web-dev-owner-tool#2708
#
# ./own.sh (Edit Before Running)!
#
targetname="root"
path="/var/www" # Path
username="www-data" # Username to be owned by!
group=":sftp_users" # Group Membership (not mandatory) Comment out this line to ignore group part!
#
echo -en "\e[92mWelcome To (c)J~Net Owner Program 2021 "
#
echo "Current Config:"
echo ""
echo "Target Username: $targetname"
echo ""
echo "Target Path: $path"
echo ""
echo "New Owner Will Be: $username"
echo ""
echo ""
while true; do
read -p "Do you wish to continue y/n?" yn
case $yn in
[Yy]* )
echo "Setting Ownership..."
sudo chown -R $username$group $path
echo ""
echo "Listing out any files that are owned by $targetname"
echo ""
for i in $(sudo find $path -user $targetname -name "*.*")
do
echo "$i"
# sudo chown $username:$group $i
done
break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
Now edit the file for your needs
- Code:
sudo gedit own.sh
Make executable
- Code:
sudo chmod +x *.sh
Run
- Code:
./own.sh
Re: Web Dev Owner Tool
On the video you see me use key words like bedit
Needs to be in your bashrc file to use this key word!
To edit that type
- Code:
alias bedit='sudo gedit ~/.bashrc'
Needs to be in your bashrc file to use this key word!
To edit that type
- Code:
sudo gedit ~/.bashrc
Similar topics
» Tool of the year bargine on ebay electric screwdriver rechargable and tool kit with tape measure etc
» J~Net Multi Tool 2021
» Android Phone Recovery Tool By J~Net
» Free antispy tool for Windows 10
» free-multi-tool-for-linux
» J~Net Multi Tool 2021
» Android Phone Recovery Tool By J~Net
» Free antispy tool for Windows 10
» free-multi-tool-for-linux
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|