Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
TetraWiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Ubuntu-Client-on-Samba4-With-Policies
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== '''Ubuntu Client In Samba''' == # First login to ubuntu client as normal user ###### First Stept to enable root login if it is ubuntu machine ################################################ sudo passwd root # it will promt you for user password from which you have login # Above command will set the password for the root user sudo sh -c 'echo "greeter-show-manual-login=true" >> /etc/lightdm/lightdm.conf' # Above will enable the GUI login of root user # Now Login as root and install 2 Packages by below command apt-get install likewise-open apt-get install openssh-server # After the Installation of the above two packages hit the below command to join the machine in the domain domainjoin-cli join capitalbank.co.in administrator # Above will Require a Restart of the machine # Now login as a domain user same as in window machine # To leave the domain hist the below command domainjoin-cli leave # After Joining the client loing to the server and do the below # switch to root user login then hit the below command echo “10.0.0.229 usernameInitial” >> /etc/hosts # Then the run below Script sh /scripts/open_login # The above script contains ############################################################################################################################### ############################# This File is responsible to make newly added user to be login by server without password ######## username=`tail -n 1 /etc/hosts | awk '{print $2 }'` ssh root@$username 'mkdir -p .ssh' cat /root/.ssh/id_rsa.pub | ssh root@$username 'cat >> .ssh/authorized_keys' ssh root@$username "chmod 700 .ssh; chmod 640 .ssh/authorized_keys" ############################################################################################################################### sh /scripts/LDUPolicy # The above script contains ########################################################################################################### ######## This File Is responsible to add or update the user in linux ou in Samba4 for GPO ################# #!/bin/bash defaulthomepath=home/likewise-open/CAPITALBANK for username in `tail -n 1 /etc/hosts| awk '{print $2}'` do echo "$username" echo "Updating the wallpaper on user $username" rsync -aP /home/userdoc/capital.jpg root@$username:/usr/share/backgrounds/capital.jpg && rsync -aP /scripts/.wallpaper root@$username:/$defaulthomepath/$username/ && echo "wallpaper updation done" if [ `ssh root@$username "awk '/home/' /${defaulthomepath}/${username}/.profile | wc -l"` -eq 0 -o `ssh root@$username "awk '/home/' /${defaulthomepath}/${username}/.bashrc | wc -l"` -eq 0 ] then echo " Adding Profile" echo " sh /$defaulthomepath/$username/.wallpaper " echo " sh /$defaulthomepath/$username/.wallpaper " | ssh root@$username "cat >> /${defaulthomepath}/${username}/.profile" && echo " sh /$defaulthomepath/$username/.wallpaper " | ssh root@$username "cat >> /${defaulthomepath}/${username}/.bashrc" && echo "Added profile succesfully " else echo " Already A member " fi echo "Policy getting updated to block control panel (system setting) in linux " ssh root@$username "chmod 700 /usr/bin/gnome-control-center" && echo "updated system setting blocked for the normal user " echo "Policy to restrict user to change there lan setting" ssh root@$username "chmod 700 /usr/bin/nm-connection-editor" && echo "Updated to restrict user to change there network setting for " echo "folder redirection for linux users" rsync -aP root@$username:/$defaulthomepath/$username/Documents/* /home/userdoc/$username/ ;chmod 744 /home/userdoc/$username/ && echo "Folder Redirection directory created and data transferd " echo "Block user to open terminal" ssh root@$username "chmod 700 /usr/bin/gnome-terminal" && echo "Users were blocked to open terminal" echo "PROCESS SUCCESSFULLY COMPLITED FOR THE USER $username " done ########################################################################################################### # There is a crontab running for the folder redirection of all the linux user in every half hour which runs the script whit contains the below ################################################################################################################# ############### Responsible for user folder redirection ######################################################### #!/bin/bash defaulthomepath=home/likewise-open/CAPITALBANK for username in `cat /etc/hosts | (read; read; read; cat )| awk '{print $2}'` do rsync -aP --delete root@$username:/$defaulthomepath/$username/Documents/* /home/userdoc/$username/ done '''Note''' : We have Implement the only 5 policies which was required as project contract for linux machine but this is not the standard way to do so, but for doing it require High end Server to configure puppet (free but under development stage not yet stable properly ) or centrify (paid tool for cross plateform policies management ).
Summary:
Please note that all contributions to TetraWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
TetraWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)