<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.tetrain.com/index.php?action=history&amp;feed=atom&amp;title=Ubuntu-Client-on-Samba4-With-Policies</id>
	<title>Ubuntu-Client-on-Samba4-With-Policies - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.tetrain.com/index.php?action=history&amp;feed=atom&amp;title=Ubuntu-Client-on-Samba4-With-Policies"/>
	<link rel="alternate" type="text/html" href="https://wiki.tetrain.com/index.php?title=Ubuntu-Client-on-Samba4-With-Policies&amp;action=history"/>
	<updated>2026-07-25T07:34:09Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://wiki.tetrain.com/index.php?title=Ubuntu-Client-on-Samba4-With-Policies&amp;diff=1700&amp;oldid=prev</id>
		<title>Amit: Created page with &quot;Category:Capital Bank   == &#039;&#039;&#039;Ubuntu Client In Samba&#039;&#039;&#039; ==    # First login to ubuntu client as normal user   ###### First Stept to enable root login if it is ubuntu machi...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.tetrain.com/index.php?title=Ubuntu-Client-on-Samba4-With-Policies&amp;diff=1700&amp;oldid=prev"/>
		<updated>2014-07-31T07:59:39Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&lt;a href=&quot;/index.php?title=Category:Capital_Bank&quot; title=&quot;Category:Capital Bank&quot;&gt;Category:Capital Bank&lt;/a&gt;   == &amp;#039;&amp;#039;&amp;#039;Ubuntu Client In Samba&amp;#039;&amp;#039;&amp;#039; ==    # First login to ubuntu client as normal user   ###### First Stept to enable root login if it is ubuntu machi...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Capital Bank]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Ubuntu Client In Samba&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 # First login to ubuntu client as normal user &lt;br /&gt;
 ###### First Stept to enable root login if it is ubuntu machine ################################################&lt;br /&gt;
&lt;br /&gt;
 sudo passwd root # it will promt you for user password from which you have login &lt;br /&gt;
&lt;br /&gt;
 # Above command will set the password for the root user &lt;br /&gt;
&lt;br /&gt;
 sudo sh -c &amp;#039;echo &amp;quot;greeter-show-manual-login=true&amp;quot; &amp;gt;&amp;gt; /etc/lightdm/lightdm.conf&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 # Above will enable the GUI login of root user&lt;br /&gt;
 # Now Login as root and install 2 Packages by below command&lt;br /&gt;
&lt;br /&gt;
 apt-get install likewise-open&lt;br /&gt;
 apt-get install openssh-server&lt;br /&gt;
&lt;br /&gt;
 # After the Installation of the above two packages hit the below command to join the machine in the domain&lt;br /&gt;
&lt;br /&gt;
 domainjoin-cli join capitalbank.co.in administrator&lt;br /&gt;
&lt;br /&gt;
 # Above will Require a Restart of the machine &lt;br /&gt;
 # Now login as a domain user same as in window machine&lt;br /&gt;
&lt;br /&gt;
 # To leave the domain hist the below command&lt;br /&gt;
 domainjoin-cli leave&lt;br /&gt;
&lt;br /&gt;
 # After Joining the client loing to the server and do the below &lt;br /&gt;
&lt;br /&gt;
 # switch to root user login then hit the below command &lt;br /&gt;
&lt;br /&gt;
 echo “10.0.0.229		usernameInitial” &amp;gt;&amp;gt; /etc/hosts&lt;br /&gt;
&lt;br /&gt;
 # Then the run below Script &lt;br /&gt;
&lt;br /&gt;
 sh /scripts/open_login&lt;br /&gt;
&lt;br /&gt;
 # The above script contains&lt;br /&gt;
 ###############################################################################################################################&lt;br /&gt;
 ############################# This File is responsible to make newly added user to be login by server without password ########&lt;br /&gt;
&lt;br /&gt;
 username=`tail -n 1 /etc/hosts | awk &amp;#039;{print $2 }&amp;#039;`&lt;br /&gt;
&lt;br /&gt;
 ssh root@$username &amp;#039;mkdir -p .ssh&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 cat /root/.ssh/id_rsa.pub | ssh root@$username &amp;#039;cat &amp;gt;&amp;gt; .ssh/authorized_keys&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 ssh root@$username &amp;quot;chmod 700 .ssh; chmod 640 .ssh/authorized_keys&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ###############################################################################################################################&lt;br /&gt;
&lt;br /&gt;
 sh /scripts/LDUPolicy &lt;br /&gt;
&lt;br /&gt;
 # The above script contains&lt;br /&gt;
&lt;br /&gt;
 ###########################################################################################################&lt;br /&gt;
 ######## This File Is responsible to add or update the user in linux ou in Samba4 for GPO #################&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
&lt;br /&gt;
 defaulthomepath=home/likewise-open/CAPITALBANK&lt;br /&gt;
&lt;br /&gt;
 for username in `tail -n 1 /etc/hosts| awk &amp;#039;{print $2}&amp;#039;`&lt;br /&gt;
 do &lt;br /&gt;
 echo &amp;quot;$username&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;Updating the wallpaper on user $username&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 rsync -aP /home/userdoc/capital.jpg root@$username:/usr/share/backgrounds/capital.jpg &amp;amp;&amp;amp; rsync -aP /scripts/.wallpaper root@$username:/$defaulthomepath/$username/  &amp;amp;&amp;amp; echo &amp;quot;wallpaper updation done&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 if [ `ssh root@$username &amp;quot;awk &amp;#039;/home/&amp;#039; /${defaulthomepath}/${username}/.profile | wc -l&amp;quot;` -eq 0 -o `ssh root@$username &amp;quot;awk &amp;#039;/home/&amp;#039; /${defaulthomepath}/${username}/.bashrc | wc -l&amp;quot;` -eq 0 ]&lt;br /&gt;
&lt;br /&gt;
 then&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot; Adding Profile&amp;quot;&lt;br /&gt;
 echo &amp;quot; sh /$defaulthomepath/$username/.wallpaper &amp;quot; &lt;br /&gt;
 echo &amp;quot; sh /$defaulthomepath/$username/.wallpaper &amp;quot; | ssh root@$username &amp;quot;cat &amp;gt;&amp;gt; /${defaulthomepath}/${username}/.profile&amp;quot; &amp;amp;&amp;amp; echo &amp;quot; sh /$defaulthomepath/$username/.wallpaper &amp;quot; | ssh root@$username &amp;quot;cat &amp;gt;&amp;gt; /${defaulthomepath}/${username}/.bashrc&amp;quot; &amp;amp;&amp;amp; echo &amp;quot;Added profile succesfully &amp;quot;&lt;br /&gt;
&lt;br /&gt;
 else&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot; Already A member &amp;quot;&lt;br /&gt;
&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;Policy getting updated to block control panel (system setting) in linux &amp;quot;&lt;br /&gt;
&lt;br /&gt;
 ssh root@$username &amp;quot;chmod 700 /usr/bin/gnome-control-center&amp;quot; &amp;amp;&amp;amp; echo &amp;quot;updated system setting blocked for the normal user &amp;quot;&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;Policy to restrict user to change there lan setting&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 ssh root@$username  &amp;quot;chmod 700 /usr/bin/nm-connection-editor&amp;quot; &amp;amp;&amp;amp; echo &amp;quot;Updated to restrict user to change there network setting for &amp;quot;&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;folder redirection for linux users&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 rsync -aP root@$username:/$defaulthomepath/$username/Documents/* /home/userdoc/$username/ ;chmod 744 /home/userdoc/$username/  &amp;amp;&amp;amp; echo &amp;quot;Folder Redirection directory created and data transferd &amp;quot;&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;Block user to open terminal&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 ssh root@$username &amp;quot;chmod 700 /usr/bin/gnome-terminal&amp;quot; &amp;amp;&amp;amp; echo &amp;quot;Users were blocked to open terminal&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;PROCESS SUCCESSFULLY COMPLITED FOR THE USER $username &amp;quot;&lt;br /&gt;
&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
 ###########################################################################################################&lt;br /&gt;
&lt;br /&gt;
 # 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&lt;br /&gt;
&lt;br /&gt;
 #################################################################################################################&lt;br /&gt;
 ############### Responsible for user folder redirection #########################################################&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
&lt;br /&gt;
 defaulthomepath=home/likewise-open/CAPITALBANK&lt;br /&gt;
&lt;br /&gt;
 for username in `cat /etc/hosts | (read; read; read; cat )| awk &amp;#039;{print $2}&amp;#039;`&lt;br /&gt;
 do &lt;br /&gt;
&lt;br /&gt;
 rsync -aP --delete root@$username:/$defaulthomepath/$username/Documents/* /home/userdoc/$username/&lt;br /&gt;
&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;Note&amp;#039;&amp;#039;&amp;#039; : 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,&lt;br /&gt;
  but for doing it require High end Server to configure puppet (free but under development stage not yet stable properly ) or &lt;br /&gt;
  centrify (paid tool for cross plateform policies management ).&lt;/div&gt;</summary>
		<author><name>Amit</name></author>
	</entry>
</feed>