<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how to set up 'su' command for Yocto in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/how-to-set-up-su-command-for-Yocto/m-p/555530#M86495</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Radim&lt;/P&gt;&lt;P&gt;You are right, the problem is the partition doesn't have SUID bit set, so the system ignores the SUID bit set with the 'su' command.&lt;/P&gt;&lt;P&gt;Thanks for taking so much time to look into this issue for me, without your helps I would never achieve this!&lt;/P&gt;&lt;P&gt;Many thanks, now it all works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Damien&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 31 Aug 2016 00:54:04 GMT</pubDate>
    <dc:creator>damienhuang</dc:creator>
    <dc:date>2016-08-31T00:54:04Z</dc:date>
    <item>
      <title>how to set up 'su' command for Yocto</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/how-to-set-up-su-command-for-Yocto/m-p/555522#M86487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need some help on how to set up and use the "su" command within yocto jethro.&lt;/P&gt;&lt;P&gt;I have added two users into yocto, one is 'root' while the other is 'normal'. They both have its own password and I can ssh into either user from a different machine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but when I issue command "su" and want to switch from user 'normal' to 'root', even with a correct 'root' password, I am still getting "su: Authentication failure" and not able to switch to root.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can help me with this would be much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;many thanks&lt;/P&gt;&lt;P&gt;Damien&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Aug 2016 05:30:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/how-to-set-up-su-command-for-Yocto/m-p/555522#M86487</guid>
      <dc:creator>damienhuang</dc:creator>
      <dc:date>2016-08-24T05:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to set up 'su' command for Yocto</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/how-to-set-up-su-command-for-Yocto/m-p/555523#M86488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Damien&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try to look, if you have set SUID by this command:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;$ ls -l /bin/su.shadow&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Your output should look like this:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;-rwsr-xr-x 1 root root 43904 Jan 14 16:51 /bin/su.shadow&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;If you don't have the "s" bit set, run this command and it should start work:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;chmod +s /bin/su.shadow&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Aug 2016 06:56:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/how-to-set-up-su-command-for-Yocto/m-p/555523#M86488</guid>
      <dc:creator>radimkratochvil</dc:creator>
      <dc:date>2016-08-24T06:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to set up 'su' command for Yocto</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/how-to-set-up-su-command-for-Yocto/m-p/555524#M86489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Radim for your message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried below commands without luck. As you can see, the su.shadow file &lt;/P&gt;&lt;P&gt;had SUID bit set, but I just can not su from a normal user (i.e. &lt;/P&gt;&lt;P&gt;'factory') to root. Funny enough, I can su from root to normal user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#&lt;/P&gt;&lt;P&gt;#ssh as root, I can su to normal user 'factory'&lt;/P&gt;&lt;P&gt;root@chroot ~# ls -l /bin/su&lt;/P&gt;&lt;P&gt;lrwxrwxrwx    1 root     root            14 Aug 24 11:29 /bin/su -&amp;gt; &lt;/P&gt;&lt;P&gt;/bin/su.shadow&lt;/P&gt;&lt;P&gt;root@chroot ~# ls -l /bin/su.shadow&lt;/P&gt;&lt;P&gt;-rwxr-xr-x    1 root     root         43908 Aug 24 11:29 /bin/su.shadow&lt;/P&gt;&lt;P&gt;root@chroot ~# chmod +s /bin/su.shadow&lt;/P&gt;&lt;P&gt;root@chroot ~# ls -l /bin/su.shadow&lt;/P&gt;&lt;P&gt;-rwsr-sr-x    1 root     root         43908 Aug 24 11:29 /bin/su.shadow&lt;/P&gt;&lt;P&gt;root@chroot ~# su factory&lt;/P&gt;&lt;P&gt;factory@chroot&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#&lt;/P&gt;&lt;P&gt;#ssh as normal user 'factory', I can not su to 'root'&lt;/P&gt;&lt;P&gt;damien@DH-ubt14:~$ ssh factory@10.211.190.192&lt;/P&gt;&lt;P&gt;factory@10.211.190.192's password:&lt;/P&gt;&lt;P&gt;localhost:~$ ls -l /bin/su.shadow&lt;/P&gt;&lt;P&gt;-rwsr-sr-x    1 root     root         43908 Aug 17 04:06 /bin/su.shadow&lt;/P&gt;&lt;P&gt;localhost:~$ su root&lt;/P&gt;&lt;P&gt;Password:&lt;/P&gt;&lt;P&gt;su: Authentication failure&lt;/P&gt;&lt;P&gt;localhost:~$ su root&lt;/P&gt;&lt;P&gt;Password:&lt;/P&gt;&lt;P&gt;su: Authentication failure&lt;/P&gt;&lt;P&gt;localhost:~$&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2016 03:30:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/how-to-set-up-su-command-for-Yocto/m-p/555524#M86489</guid>
      <dc:creator>damienhuang</dc:creator>
      <dc:date>2016-08-25T03:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to set up 'su' command for Yocto</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/how-to-set-up-su-command-for-Yocto/m-p/555525#M86490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Damien,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the file "&lt;EM&gt;/etc/login.defs"&lt;/EM&gt; uncomment line:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;#SULOG_FILE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /var/log/sulog&lt;/BLOCKQUOTE&gt;&lt;P&gt;Now try to use su from factory user and send me both file ( "&lt;EM&gt;/etc/login.defs"&lt;/EM&gt; and "/var/log/sulog"). And if you can, send me also file "&lt;EM&gt;/etc/passwd&lt;/EM&gt;".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Radim.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2016 06:14:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/how-to-set-up-su-command-for-Yocto/m-p/555525#M86490</guid>
      <dc:creator>radimkratochvil</dc:creator>
      <dc:date>2016-08-25T06:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to set up 'su' command for Yocto</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/how-to-set-up-su-command-for-Yocto/m-p/555526#M86491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Radim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please see attachment for the two files and below for the action list I did.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;damien@DH-ubt14:~$ ssh factory@10.211.190.192&lt;/P&gt;&lt;P&gt;factory@10.211.190.192's password:&lt;/P&gt;&lt;P&gt;localhost:~$ su root&lt;/P&gt;&lt;P&gt;Password:&lt;/P&gt;&lt;P&gt;su: Authentication failure&lt;/P&gt;&lt;P&gt;localhost:~$ cat sulog&lt;/P&gt;&lt;P&gt;SU 08/26 00:20 - /dev/pts/1 factory-root&lt;/P&gt;&lt;P&gt;localhost:~$&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Aug 2016 00:26:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/how-to-set-up-su-command-for-Yocto/m-p/555526#M86491</guid>
      <dc:creator>damienhuang</dc:creator>
      <dc:date>2016-08-26T00:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to set up 'su' command for Yocto</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/how-to-set-up-su-command-for-Yocto/m-p/555527#M86492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Damien,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is really weird, everything looks fine. I also tested this many times in the jethro and every time it worked. Please send me files &lt;CODE&gt;/etc/passwd&lt;/CODE&gt; and &lt;CODE&gt;/etc/shadow&lt;/CODE&gt;. Do you did some changes in the system? Did you try to change root password, or delete the user and add him again?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Radim.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Aug 2016 13:30:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/how-to-set-up-su-command-for-Yocto/m-p/555527#M86492</guid>
      <dc:creator>radimkratochvil</dc:creator>
      <dc:date>2016-08-26T13:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to set up 'su' command for Yocto</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/how-to-set-up-su-command-for-Yocto/m-p/555528#M86493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Radim for taking the time on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please see attachment for /etc/passwd &amp;amp; /etc/shadow. I firstly changed&lt;/P&gt;&lt;P&gt;the root user's password from no password to 'abc' and then added a new&lt;/P&gt;&lt;P&gt;user "factory" with password 'cba'. and start the su command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the action list I did are given blow:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//1) ssh into the system with root&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dropbear ssh server started&lt;/P&gt;&lt;P&gt;********************************&lt;/P&gt;&lt;P&gt;Hi root,&lt;/P&gt;&lt;P&gt;You are in chroot jail now ...&lt;/P&gt;&lt;P&gt;eth0 with IP=10.211.190.192&lt;/P&gt;&lt;P&gt;root@chroot ~# passwd&lt;/P&gt;&lt;P&gt;Changing password for root&lt;/P&gt;&lt;P&gt;New password:&lt;/P&gt;&lt;P&gt;Retype password:&lt;/P&gt;&lt;P&gt;Password for root changed by root&lt;/P&gt;&lt;P&gt;root@chroot ~# adduser factory&lt;/P&gt;&lt;P&gt;adduser: user 'factory' in use&lt;/P&gt;&lt;P&gt;root@chroot ~# deluser factory&lt;/P&gt;&lt;P&gt;root@chroot ~# adduser factory&lt;/P&gt;&lt;P&gt;Changing password for factory&lt;/P&gt;&lt;P&gt;New password:&lt;/P&gt;&lt;P&gt;Retype password:&lt;/P&gt;&lt;P&gt;Password for factory changed by root&lt;/P&gt;&lt;P&gt;root@chroot ~# chmod +s /bin/su.shadow&lt;/P&gt;&lt;P&gt;root@chroot ~#&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//2) ssh as factory&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;damien@DH-ubt14:~$ ssh factory@10.211.190.192&lt;/P&gt;&lt;P&gt;factory@10.211.190.192's password:&lt;/P&gt;&lt;P&gt;localhost:~$ su&lt;/P&gt;&lt;P&gt;Password:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;setgid: Operation not permitted &amp;nbsp;//why it is different error? last time is "su: Authentication failure"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;localhost:~$&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would the problem be with chroot? the yocto environment that I ssh into&lt;/P&gt;&lt;P&gt;actually is a chroot environment within an Android system, could the su&lt;/P&gt;&lt;P&gt;command actually tries to switch to android's root user rather than the&lt;/P&gt;&lt;P&gt;chrooted yocto root user? There is definitely something weird, because&lt;/P&gt;&lt;P&gt;when I ssh into it, I use the password of yocto root not the Android root.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 00:25:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/how-to-set-up-su-command-for-Yocto/m-p/555528#M86493</guid>
      <dc:creator>damienhuang</dc:creator>
      <dc:date>2016-08-29T00:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to set up 'su' command for Yocto</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/how-to-set-up-su-command-for-Yocto/m-p/555529#M86494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Damien,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there is still some problems with permissions. How do you mount the filesystem for yocto? If you have it on different partition you can try to remount it with:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE&gt;&lt;CODE&gt;mount -o remount,suid /path_to_the_chroot_folder&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It have to be mount with suid or defaults, if it is not, the kernel ignore the SUID bit. If it will not help, please look, what permission (with command ls -l) is set fot /etc/passwd and /etc/shadow and send it to me. Also send me what is in variable PATH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Radim.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 10:23:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/how-to-set-up-su-command-for-Yocto/m-p/555529#M86494</guid>
      <dc:creator>radimkratochvil</dc:creator>
      <dc:date>2016-08-29T10:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to set up 'su' command for Yocto</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/how-to-set-up-su-command-for-Yocto/m-p/555530#M86495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Radim&lt;/P&gt;&lt;P&gt;You are right, the problem is the partition doesn't have SUID bit set, so the system ignores the SUID bit set with the 'su' command.&lt;/P&gt;&lt;P&gt;Thanks for taking so much time to look into this issue for me, without your helps I would never achieve this!&lt;/P&gt;&lt;P&gt;Many thanks, now it all works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Damien&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2016 00:54:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/how-to-set-up-su-command-for-Yocto/m-p/555530#M86495</guid>
      <dc:creator>damienhuang</dc:creator>
      <dc:date>2016-08-31T00:54:04Z</dc:date>
    </item>
  </channel>
</rss>

