<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" >

<channel><title><![CDATA[Useful Tips and Tricks - OS]]></title><link><![CDATA[http://www.anwarsayed.com/os]]></link><description><![CDATA[OS]]></description><pubDate>Mon, 30 Mar 2026 22:54:19 -0700</pubDate><generator>Weebly</generator><item><title><![CDATA[Take Control of your Linux | sudoers file: ]]></title><link><![CDATA[http://www.anwarsayed.com/os/take-control-of-your-linux-sudoers-file]]></link><comments><![CDATA[http://www.anwarsayed.com/os/take-control-of-your-linux-sudoers-file#comments]]></comments><pubDate>Wed, 08 Jul 2015 03:07:38 GMT</pubDate><category><![CDATA[Uncategorized]]></category><guid isPermaLink="false">http://www.anwarsayed.com/os/take-control-of-your-linux-sudoers-file</guid><description><![CDATA[The&nbsp;sudoers&nbsp;file located at:&nbsp;/etc/sudoers, contains the rules that users must follow when using the sudo command.If you have ever used used Ubuntu, you know that the root account is disabled. This is because the root password is not set in Ubuntu, you can assign one and use it as with every other Linux distribution. That anyway is another story. On normal Ubuntu Linux computers you need to use&nbsp;sudo&nbsp;to act as root.I like using&nbsp;sudo, I'm not using Ubuntu anymore. The  [...] ]]></description><content:encoded><![CDATA[<div class="paragraph" style="text-align:left;">The&nbsp;sudoers&nbsp;file located at:&nbsp;/etc/sudoers, contains the rules that users must follow when using the sudo command.<br /><span style=""></span><br /><span style=""></span>If you have ever used used Ubuntu, you know that the root account is disabled. This is because the root password is not set in Ubuntu, you can assign one and use it as with every other Linux distribution. That anyway is another story. On normal Ubuntu Linux computers you need to use&nbsp;sudo&nbsp;to act as root.<br /><span style=""></span><br /><span style=""></span>I like using&nbsp;sudo, I'm not using Ubuntu anymore. The first thing I do when I install a new Linux is to usevisudo&nbsp;to edit the sudoers file. And I always give my account root rights, then I can run commands as root without switching users.<br /><span style=""></span><br /><span style=""></span>The best way to understand the&nbsp;sudo&nbsp;command, and the rules in sudoers file, the funny way is by this comics.<br /><span style=""></span><br /><span style=""></span></div>  <div><div class="wsite-image wsite-image-border-none " style="padding-top:10px;padding-bottom:10px;margin-left:0;margin-right:0;text-align:center"> <a> <img src="http://www.anwarsayed.com/uploads/1/8/3/9/1839021/4824354_orig.png" alt="Picture" style="width:auto;max-width:100%" /> </a> <div style="display:block;font-size:90%"></div> </div></div>  <div class="paragraph">As you can see from this funny picture, using&nbsp;sudo&nbsp;command, makes the system obey any given order.<br /><span style=""></span><br /><span style=""></span>The two best advantages about using&nbsp;sudo&nbsp;command are:<br /><span style=""></span><br /><span style=""></span><ul style=""><li style="">Restricted privileges</li><li style="">Logs of the actions taken by users</li></ul>I'm sure you are now fully aware of the advantages of using&nbsp;sudo&nbsp;command in a daily basis, how to use it?<br /><span style=""></span><br /><span style=""></span>In order to use&nbsp;sudo&nbsp;you first need to configure the sudoers file. The sudoers file is located at/etc/sudoers. And you should not edit it directly, you need to use the&nbsp;visudo&nbsp;command.<br /><span style=""></span><br /><span style=""></span>Once you enter&nbsp;visudo&nbsp;command, you will see something like this:<br /><span style=""></span><br /><span style=""></span># /etc/sudoers&nbsp;<br />#&nbsp;<br /># This file MUST be edited with the 'visudo' command as root.&nbsp;<br />#&nbsp;<br /># See the man page for details on how to write a sudoers file.&nbsp;<br />#  Defaults        env_reset&nbsp;<br />&nbsp;# Host alias specification&nbsp;<br />&nbsp;# User alias specification&nbsp;<br />&nbsp;# Cmnd alias specification&nbsp;<br />&nbsp;# User privilege specification&nbsp;<br />root    ALL=(ALL) ALL <br /><span style=""></span><br /><span style=""></span>Almost all lines are commented out, the one that matters in this sudoers file example is:<br /><span style=""></span><br /><span style=""></span>root ALL=(ALL) ALL <br /><span style=""></span><br /><span style=""></span>This line means: The root user can execute from&nbsp;<em style="">ALL</em>&nbsp;terminals, acting as&nbsp;<em style="">ALL</em>&nbsp;(any) users, and run&nbsp;<em style="">ALL</em>&nbsp;(any) command.<br /><span style=""></span><br /><span style=""></span>The first part is the user, the second is the terminal from where the user can use&nbsp;sudo&nbsp;command, the third part is which users he may act as, and the last one, is which commands he may run when using&nbsp;sudo.<br /><span style=""></span><br /><span style=""></span>sudoers examplesoperator ALL= /sbin/poweroff <br /><span style=""></span><br /><span style=""></span>The above command, makes the user operator can from any terminal, run the command power off.<br /><span style=""></span><br /><span style=""></span>You can also create aliases for: users -&gt; User_Alias, run commands as other users -&gt; Runas_Alias, host -&gt; Host_Alias and command -&gt; Cmnd_Alias<br /><span style=""></span><br /><span style=""></span>User_Alias OPERATORS = joe, mike, jude&nbsp;<br />Runas_Alias OP = root, operator&nbsp;<br />Host_Alias OFNET = 10.1.2.0/255.255.255.0&nbsp;<br />Cmnd_Alias PRINTING = /usr/sbin/lpc, /usr/bin/lprm <br /><span style=""></span><br /><span style=""></span>As you can see the alias OPERATORS includes the users joe, mike and jude, the alias OP includes the users root and operator, alias OFNET includes the network 10.1.2.0 (all the C class), and the command alias PRINTING includes the commands lpc and lprm.<br /><span style=""></span><br /><span style=""></span>So, a typical sudoers file may look like this:<br /><span style=""></span><br /><br /><span style=""></span></div>  <div><div class="wsite-image wsite-image-border-none " style="padding-top:10px;padding-bottom:10px;margin-left:0;margin-right:0;text-align:center"> <a> <img src="http://www.anwarsayed.com/uploads/1/8/3/9/1839021/3469160_orig.png" alt="Picture" style="width:auto;max-width:100%" /> </a> <div style="display:block;font-size:90%"></div> </div></div>  <div class="paragraph" style="text-align:left;">If you want not to be asked for a password use this form:<br /><span style=""></span><br /><span style=""></span>go2linux ALL=(ALL) NOPASSWD: ALL <br /><span style=""></span><br /><span style=""></span>You may want to read sudoers man page<br /><span style=""></span><br /><span style=""></span>Considering that you are still reading here a bonus:<br /><span style=""></span><br /><span style=""></span>visudo&nbsp;command uses&nbsp;vi&nbsp;as the editor here some tips to use it:<br /><span style=""></span><br /><span style=""></span><ol style=""><li style="">Switch to root, (su root), then run visudo, (as above).</li><li style="">Find where it says "root ALL=(ALL) ALL".</li><li style="">Type "o" to insert a new line below it.</li><li style="">Now type what you want to insert, eg "username ALL=(ALL) ALL".</li><li style="">Hit esc to exit insert-mode.</li><li style="">Type ":x" to save and exit.</li></ol><strong style="">Can I change the default&nbsp;visudo&nbsp;editor?</strong><br /><span style=""></span><br /><span style=""></span>Yes, changing the default&nbsp;visudo&nbsp;editor is easy.<br /><span style=""></span><br /><span style=""></span>And just because of your dedication, and still reading until here, I'll show you how to set&nbsp;nano&nbsp;or&nbsp;vim&nbsp;to use with&nbsp;visudo&nbsp;command as default editor.<br /><span style=""></span><br /><span style=""></span><strong style="">Using vim with visudo</strong><br /><span style=""></span><br /><span style=""></span>export VISUAL=vim; visudo <br /><span style=""></span><br /><span style=""></span><strong style="">Using nano with visudo</strong><br /><span style=""></span><br /><span style=""></span>export VISUAL=nano; visudo<br /><br /><br /><br /><br /><font size="1"><em>source :&nbsp;http://bencane.com/</em></font><br /><br /><span style=""></span><br /><span style=""></span></div>]]></content:encoded></item><item><title><![CDATA[Understanding a little more about /etc/profile and /etc/bashrc]]></title><link><![CDATA[http://www.anwarsayed.com/os/understanding-a-little-more-about-etcprofile-and-etcbashrc]]></link><comments><![CDATA[http://www.anwarsayed.com/os/understanding-a-little-more-about-etcprofile-and-etcbashrc#comments]]></comments><pubDate>Tue, 07 Jul 2015 02:42:29 GMT</pubDate><category><![CDATA[Uncategorized]]></category><guid isPermaLink="false">http://www.anwarsayed.com/os/understanding-a-little-more-about-etcprofile-and-etcbashrc</guid><description><![CDATA[Recently I was working on an issue where an application was not retaining the umask setting set in the root users profile or&nbsp;/etc/profile. After looking into the issue a bit it seemed that the application in question only applied the umask setting that was set in&nbsp;/etc/bashrc&nbsp;and would not even accept the values being the applications own start scripts.After doing a bit of researched I learned a little bit more about what exactly these files do, the differences between them and whe [...] ]]></description><content:encoded><![CDATA[<div class="paragraph" style="text-align:left;">Recently I was working on an issue where an application was not retaining the umask setting set in the root users profile or&nbsp;/etc/profile. After looking into the issue a bit it seemed that the application in question only applied the umask setting that was set in&nbsp;/etc/bashrc&nbsp;and would not even accept the values being the applications own start scripts.<br /><span style=""></span><br /><span style=""></span>After doing a bit of researched I learned a little bit more about what exactly these files do, the differences between them and when they are executed. I figured this would be a good thing to share as it is not a topic that comes up very often.<br /><span style=""></span><br /><span style=""></span>What is /etc/profile used for?If you have been using Linux for a while you are probably familiar with the&nbsp;.profile&nbsp;or.bash_profile&nbsp;files in your home directory. These files are used to set environmental items for a users shell. Items such as umask, and variables such as&nbsp;PS1&nbsp;or&nbsp;PATH.<br /><span style=""></span><br /><span style=""></span>The&nbsp;/etc/profile&nbsp;file is not very different however it is used to set system wide environmental variables on users shells. The variables are sometimes the same ones that are in the&nbsp;.bash_profile, however this file is used to set an initial&nbsp;PATH&nbsp;or&nbsp;PS1&nbsp;for all shell users of the system.<br /><span style=""></span><br /><span style=""></span>/etc/profile.dIn addition to the setting environmental items the&nbsp;/etc/profile&nbsp;will execute the scripts within/etc/profile.d/*.sh. If you plan on setting your own system wide environmental variables it is recommended to place your configuration in a shell script within&nbsp;/etc/profile.d.<br /><span style=""></span><br /><span style=""></span>What is /etc/bashrc used for?Like&nbsp;.bash_profile&nbsp;you will also commonly see a .bashrc file in your home directory. This file is meant for setting command aliases and functions used by bash shell users.<br /><span style=""></span><br /><span style=""></span>Just like the&nbsp;/etc/profile&nbsp;is the system wide version of&nbsp;.bash_profile. The&nbsp;/etc/bashrc&nbsp;for Red Hat and&nbsp;/etc/bash.bashrc&nbsp;in Ubuntu is the system wide version of&nbsp;.bashrc.<br /><span style=""></span><br /><span style=""></span>Interestingly enough in the Red Hat implementation the&nbsp;/etc/bashrc&nbsp;also executes the shell scripts within&nbsp;/etc/profile.d&nbsp;but only if the users shell is a Interactive Shell (aka Login Shell)<br /><span style=""></span><br /><span style=""></span>When are these files used?The difference between when these two files are executed are dependent on the type of login being performed. In Linux you can have two types of login shells, Interactive Shells and Non-Interactive Shells. An Interactive shell is used where a user can interact with the shell, i.e. your typical bash prompt. Whereas a non-Interactive shell is used when a user cannot interact with the shell, i.e. a bash scripts execution.<br /><span style=""></span><br /><span style=""></span>The difference is simple, the&nbsp;/etc/profile&nbsp;is executed only for interactive shells and the&nbsp;/etc/bashrcis executed for both interactive and non-interactive shells. In fact in Ubuntu the&nbsp;/etc/profile&nbsp;calls the&nbsp;/etc/bashrc&nbsp;directly.<br /><span style=""></span><br /><span style=""></span>Interactive Shell vs Non-Interactive ShellTo show an example of an interactive shell vs a non-interactive shell I will add a variable into both/etc/profile&nbsp;and&nbsp;/etc/bash.bashrc&nbsp;on my Ubuntu system.<br /><span style=""></span><br /><span style=""></span><br />/etc/profile# grep TEST /etc/profile export TESTPROFILE=1 <br /><span style=""></span><br /><span style=""></span>/etc/bash.bashrc# grep TEST /etc/bash.bashrc  export TESTBASHRC=1 <br /><span style=""></span><br /><span style=""></span>Interactive ShellThe below example is showing an interactive shell, in this case both the&nbsp;/etc/profile&nbsp;and/etc/bash.bashrc&nbsp;was executed.<br /><span style=""></span><br /><span style=""></span># su - # env | grep TEST TESTBASHRC=1 TESTPROFILE=1 <br /><span style=""></span><br /><span style=""></span>Non-Interactive ShellIn this example we are running a command through SSH that is non-interactive; because this is a non-interactive shell only the&nbsp;/etc/bash.bashrc&nbsp;file is executed.<br /><span style=""></span><br /><span style=""></span># ssh localhost "env | grep TEST" root@localhost's password:  TESTBASHRC=1 <br /><span style=""></span><br /><span style=""></span>ConclusionIn my case the applications child processes are not recognizing the umask value set in&nbsp;/etc/profilebut do recognize the value in&nbsp;/etc/bashrc. This tells me that the subprocess is starting as a non-interactive shell. While the suggested route of modifying environmental variables is to add a shell script into&nbsp;/etc/profile.d&nbsp;in my case it is better to set the umask value in the&nbsp;/etc/bashrc.<br /><span style=""></span><br /><span style=""></span></div>]]></content:encoded></item><item><title><![CDATA[ConnectBot -Secure Shell client available for the Android]]></title><link><![CDATA[http://www.anwarsayed.com/os/connectbot-secure-shell-client-available-for-the-android]]></link><comments><![CDATA[http://www.anwarsayed.com/os/connectbot-secure-shell-client-available-for-the-android#comments]]></comments><pubDate>Mon, 25 Feb 2013 09:42:30 GMT</pubDate><category><![CDATA[Uncategorized]]></category><guid isPermaLink="false">http://www.anwarsayed.com/os/connectbot-secure-shell-client-available-for-the-android</guid><description><![CDATA[ConnectBot is the most popular Secure Shell client available for the Android operating system.&nbsp;It lets users securely log in remotely to servers that run a secure shell daemon. This allows the user to enter commands from their android device and have the commands run on the remote server instead of the local android device. ConnectBot at Google Play~ Some of its features are  It supports login with a username and password to any arbitrary server on the local network or internet Supports con [...] ]]></description><content:encoded><![CDATA[<div class="paragraph">ConnectBot is the most popular Secure Shell client available for the Android operating system.&nbsp;It lets users securely log in remotely to servers that run a secure shell daemon. This allows the user to enter commands from their android device and have the commands run on the remote server instead of the local android device.<BR><SPAN></SPAN> <LI><A href="https://play.google.com/store/apps/details?id=org.connectbot" rel=nofollow><U>ConnectBot at Google Play</U></A></LI>~</LI> <LI id=inside_525805142232409340 class=inside _prototypeUID="159"><BR><SPAN></SPAN>Some of its features are<BR> <UL> <LI>It supports login with a username and password to any arbitrary server on the local network or internet</LI> <LI>Supports connections based on a public/private keypair instead of username/password for increased security</LI> <LI>Allows frequently accessed hosts to be saved in a menu, so that they can quickly be re-connected to</LI></UL></div>]]></content:encoded></item><item><title><![CDATA[Protecting your computer from cracking ]]></title><link><![CDATA[http://www.anwarsayed.com/os/protecting-your-computer-from-cracking]]></link><comments><![CDATA[http://www.anwarsayed.com/os/protecting-your-computer-from-cracking#comments]]></comments><pubDate>Mon, 16 Feb 2009 23:54:40 GMT</pubDate><category><![CDATA[Uncategorized]]></category><guid isPermaLink="false">http://www.anwarsayed.com/os/protecting-your-computer-from-cracking</guid><description><![CDATA[You may be interested in how to prevent ordinary users from doing whatever they like, if you share your computer with other people. So this chapter describes how to improve the security of GRUB. One thing which could be a security hole is that the user can do too many things with GRUB, because GRUB allows one to modify its configuration and run arbitrary commands at run-time. For example, the user can even read /etc/passwd in the command-line interface by the command cat (see cat). So it is nece [...] ]]></description><content:encoded><![CDATA[<p  style=" text-align: left; ">You may be interested in how to prevent ordinary users from doing whatever they like, if you share your computer with other people. So this chapter describes how to improve the security of GRUB. One thing which could be a security hole is that the user can do too many things with GRUB, because GRUB allows one to modify its configuration and run arbitrary commands at run-time. For example, the user can even read <SPAN class=file>/etc/passwd</SPAN> in the command-line interface by the command <SPAN class=command>cat</SPAN> (see <A href="http://www.gnu.org/software/grub/manual/html_node/cat.html#cat">cat</A>). So it is necessary to disable all the interactive operations. Thus, GRUB provides a password feature, so that only administrators can start the interactive operations (i.e. editing menu entries and entering the command-line interface). To use this feature, you need to run the command <SPAN class=command>password</SPAN> in your configuration file (see <A href="http://www.gnu.org/software/grub/manual/html_node/password.html#password">password</A>), like this: password --md5 PASSWORD <br /><br />If this is specified, GRUB disallows any interactive control, until you press the key &lt;p&gt; and enter a correct password. The option <SPAN class=option>--md5</SPAN> tells GRUB that `<SPAN class=samp>PASSWORD</SPAN>' is in MD5 format. If it is omitted, GRUB assumes the `<SPAN class=samp>PASSWORD</SPAN>' is in clear text. You can encrypt your password with the command <SPAN class=command>md5crypt</SPAN> (see <A href="http://www.gnu.org/software/grub/manual/html_node/md5crypt.html#md5crypt">md5crypt</A>). For example, run the grub shell (see <A href="http://www.gnu.org/software/grub/manual/html_node/Invoking-the-grub-shell.html#Invoking-the-grub-shell">Invoking the grub shell</A>), and enter your password: grub&gt; md5crypt Password: ********** Encrypted: $1$U$JK7xFegdxWH6VuppCUSIb. <br /><br />Then, cut and paste the encrypted password to your configuration file. Also, you can specify an optional argument to <SPAN class=command>password</SPAN>. See this example: password PASSWORD /boot/grub/menu-admin.lst <br /><br />In this case, GRUB will load <SPAN class=file>/boot/grub/menu-admin.lst</SPAN> as a configuration file when you enter the valid password. Another thing which may be dangerous is that any user can choose any menu entry. Usually, this wouldn't be problematic, but you might want to permit only administrators to run some of your menu entries, such as an entry for booting an insecure OS like DOS. GRUB provides the command <SPAN class=command>lock</SPAN> (see <A href="http://www.gnu.org/software/grub/manual/html_node/lock.html#lock">lock</A>). This command always fails until you enter the valid password, so you can use it, like this:<br /><br /> &nbsp;title Boot DOS lock rootnoverify (hd0,1) makeactive chainload +1 <br /><br />You should insert <SPAN class=command>lock</SPAN> right after <SPAN class=command>title</SPAN>, because any user can execute commands in an entry until GRUB encounters <SPAN class=command>lock</SPAN>. You can also use the command <SPAN class=command>password</SPAN> instead of <SPAN class=command>lock</SPAN>. In this case the boot process will ask for the password and stop if it was entered incorrectly. Since the <SPAN class=command>password</SPAN> takes its own PASSWORD argument this is useful if you want different passwords for different entries.<br /><br /><br /><br /></p>]]></content:encoded></item><item><title><![CDATA[Linux Distribtion Unbutu Pocket guide for free]]></title><link><![CDATA[http://www.anwarsayed.com/os/first-post]]></link><comments><![CDATA[http://www.anwarsayed.com/os/first-post#comments]]></comments><pubDate>Mon, 16 Feb 2009 21:11:16 GMT</pubDate><category><![CDATA[Uncategorized]]></category><guid isPermaLink="false">http://www.anwarsayed.com/os/first-post</guid><description><![CDATA[Go to this link to find the download link of ur conveniecehttp://www.ubuntupocketguide.com/download2.html [...] ]]></description><content:encoded><![CDATA[<p  style=" text-align: left; ">Go to this link to find the download link of ur conveniece<br /><br /><A href="http://www.ubuntupocketguide.com/download2.html">http://www.ubuntupocketguide.com/download2.html</A><br /><br /></p>]]></content:encoded></item></channel></rss>