<?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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TIBCO Admin &#187; solaris</title>
	<atom:link href="http://tibcoadmin.com/category/sun/solaris/feed/" rel="self" type="application/rss+xml" />
	<link>http://tibcoadmin.com</link>
	<description>thoughts and actions</description>
	<lastBuildDate>Fri, 02 Mar 2012 06:41:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>When zpool attach returns a device is too small error</title>
		<link>http://tibcoadmin.com/sun/solaris/when-zpool-attach-returns-a-device-is-too-small-error/</link>
		<comments>http://tibcoadmin.com/sun/solaris/when-zpool-attach-returns-a-device-is-too-small-error/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 10:30:23 +0000</pubDate>
		<dc:creator>Serge</dc:creator>
				<category><![CDATA[solaris]]></category>
		<category><![CDATA[zfs]]></category>

		<guid isPermaLink="false">http://tibcoadmin.com/?p=1125</guid>
		<description><![CDATA[I had to refresh Solaris on one of our old servers. After clean install on the first drive c1t0d0 with ZFS filesystem, I had to create root pool mirror by second drive c1t1d0 using zpool attach: # zpool attach rpool c1t0d0s0 c1t1d0s0 invalid vdev specification use '-f' to override the following errors: /dev/dsk/c1t1d0s0 contains a [...]]]></description>
			<content:encoded><![CDATA[<div class="plus-one-wrap"><g:plusone size="small" href="http://tibcoadmin.com/sun/solaris/when-zpool-attach-returns-a-device-is-too-small-error/"></g:plusone></div><p>I had to refresh Solaris on one of our old servers. After clean install on the first drive <code>c1t0d0</code> with ZFS filesystem, I had to create root pool mirror by second drive <code>c1t1d0</code> using <strong>zpool attach</strong>:</p>
<p><code># zpool attach rpool c1t0d0s0 c1t1d0s0<br />
invalid vdev specification<br />
use '-f' to override the following errors:<br />
/dev/dsk/c1t1d0s0 contains a ufs filesystem.</code></p>
<p>As <code>c1t1d0</code> had a ufs filesystem from previous installation, I tried to force:</p>
<p><code># zpool attach -f rpool c1t0d0s0 c1t1d0s0<br />
cannot attach c1t1d0s0 to c1t0d0s0: device is too small</code></p>
<p>I realized that an old disk slice <code>c1t1d0s0</code> can be smaller than <code>c1t0d0s0</code> as <code>c1t0d0s0</code> was reinitialized by installer and expanded to whole disk. I could check it using <strong>prtvtoc</strong>:</p>
<p><code># prtvtoc /dev/dsk/c1t0d0s2<br />
* /dev/dsk/c1t0d0s2 partition map<br />
*<br />
* Dimensions:<br />
*     512 bytes/sector<br />
*     848 sectors/track<br />
*      24 tracks/cylinder<br />
*   20352 sectors/cylinder<br />
*   14089 cylinders<br />
*   14087 accessible cylinders<br />
*<br />
* Flags:<br />
*   1: unmountable<br />
*  10: read-only<br />
*<br />
*                          First     Sector    Last<br />
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory<br />
       0      2    00          0 286698624 286698623<br />
       2      5    00          0 286698624 286698623<br />
#</code></p>
<p>I decided to save this map into a file and write to my second drive using <strong>fmthard</strong> then:</p>
<p><code># prtvtoc /dev/dsk/c1t0d0s2 > /tmp/vtoc_root.out<br />
# fmthard -s /tmp/vtoc_root.out /dev/rdsk/c1t1d0s2<br />
fmthard:  New volume table of contents now in place.</code></p>
<p>Now <strong>zpool attach</strong> works much better:</p>
<p><code># zpool attach rpool c1t0d0s0 c1t1d0s0<br />
Please be sure to invoke installboot(1M) to make 'c1t1d0s0' bootable.<br />
Make sure to wait until resilver is done before rebooting.<br />
</code></p>
<p><code># zpool status rpool<br />
  pool: rpool<br />
 state: ONLINE<br />
status: One or more devices is currently being resilvered.  The pool will<br />
        continue to function, possibly in a degraded state.<br />
action: Wait for the resilver to complete.<br />
 scrub: resilver in progress for 0h0m, 37.79% done, 0h1m to go<br />
config:<br />
        NAME          STATE     READ WRITE CKSUM<br />
        rpool         ONLINE       0     0     0<br />
          mirror-0    ONLINE       0     0     0<br />
            c1t0d0s0  ONLINE       0     0     0<br />
            c1t1d0s0  ONLINE       0     0     0  2.44G resilvered<br />
errors: No known data errors</code></p>
<p>Last but not least step was to make <code>c1t1d0s0</code> bootable using <strong>installboot</strong>:</p>
<p><code># installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c1t1d0s0</code></p>
]]></content:encoded>
			<wfw:commentRss>http://tibcoadmin.com/sun/solaris/when-zpool-attach-returns-a-device-is-too-small-error/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to setup a relay host in sendmail</title>
		<link>http://tibcoadmin.com/sun/solaris/how-to-setup-a-relay-host-in-sendmail/</link>
		<comments>http://tibcoadmin.com/sun/solaris/how-to-setup-a-relay-host-in-sendmail/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 20:08:18 +0000</pubDate>
		<dc:creator>Serge</dc:creator>
				<category><![CDATA[solaris]]></category>

		<guid isPermaLink="false">http://tibcoadmin.com/?p=1005</guid>
		<description><![CDATA[Often it is necessary to send all outgoing mail via the relay host from the corporate network. This is not so difficult to specify that for Solaris&#8217; sendmail. cd /usr/lib/mail/cf vi sendmail.mc Find this row in sendmail.mc and specify your relay host name or IP instead of relay.sun.com in my example: define(`confFALLBACK_SMARTHOST', `relay.sun.com')dnl Then do: [...]]]></description>
			<content:encoded><![CDATA[<div class="plus-one-wrap"><g:plusone size="small" href="http://tibcoadmin.com/sun/solaris/how-to-setup-a-relay-host-in-sendmail/"></g:plusone></div><p>Often it is necessary to send all outgoing mail via the relay host from the corporate network. This is not so difficult to specify that for Solaris&#8217; sendmail.</p>
<p><code>cd /usr/lib/mail/cf<br />
vi sendmail.mc<br />
</code></p>
<p>Find this row in <strong>sendmail.mc</strong> and specify your relay host name or IP instead of <em>relay.sun.com</em> in my example:<br />
<code><strong>define(`confFALLBACK_SMARTHOST', `relay.sun.com')dnl</strong></code></p>
<p>Then do:<br />
<code>make sendmail.cf<br />
cp sendmail.cf /etc/mail/sendmail.cf<br />
svcadm restart svc:/network/smtp:sendmail<br />
</code></p>
<p>that&#8217;s all. To test you can use <strong>mailx</strong>:<br />
<code>echo "This is the body."| mailx -s "Test subject" mail@mail.com</code></p>
]]></content:encoded>
			<wfw:commentRss>http://tibcoadmin.com/sun/solaris/how-to-setup-a-relay-host-in-sendmail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to add Solaris 10 server into MS Active Directory domain</title>
		<link>http://tibcoadmin.com/sun/solaris/how-to-add-solaris-10-server-into-ms-active-directory-domain/</link>
		<comments>http://tibcoadmin.com/sun/solaris/how-to-add-solaris-10-server-into-ms-active-directory-domain/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 14:23:35 +0000</pubDate>
		<dc:creator>Serge</dc:creator>
				<category><![CDATA[solaris]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://tibcoadmin.com/?p=372</guid>
		<description><![CDATA[Here are my notes applicable for Solaris 10. First of all install latest patches &#8211; a lot of related things fixed (but new bugs may appear :)) Synchronize the system clock with AD server domain ntp server(s) must be in /etc/inet/ntp.conf then restart ntp daemon svcadm restart /network/ntp Solaris server must have a record in [...]]]></description>
			<content:encoded><![CDATA[<div class="plus-one-wrap"><g:plusone size="small" href="http://tibcoadmin.com/sun/solaris/how-to-add-solaris-10-server-into-ms-active-directory-domain/"></g:plusone></div><p><em>Here are my notes applicable for Solaris 10. First of all install latest patches &#8211; a lot of related things fixed (but new bugs may appear :))</em></p>
<ol>
<li>Synchronize the system clock with AD server<br />
domain ntp server(s) must be in <code>/etc/inet/ntp.conf</code><br />
then restart ntp daemon <code>svcadm restart /network/ntp</code></li>
<li>Solaris server must have a record in the DNS</li>
<li>Domain name and name servers (DNS servers) must be in <code>/etc/resolv.conf</code></li>
<li>In the <code>/etc/nsswitch.conf</code> file <strong>dns</strong> and <strong>files</strong> must be specified for <strong>hosts</strong> and <strong>ipnodes</strong><br />
<code>...<br />
hosts:      dns files<br />
ipnodes:    dns files<br />
...</code></li>
<li>In the <code>/etc/nodename</code> and <code>/etc/hostname.&lt;nic&gt;</code> files <strong>host name</strong> must be specified only, not a fully qualified domain name</li>
<li>Run <strong>adjoin</strong> script. You can find it <a href="http://hub.opensolaris.org/bin/view/Project+winchester/files?viewer=attachments&amp;language=en">here</a>. It will:
<ul>
<li>auto-detects the Active Directory domain controllers</li>
<li>creates a machine account (also called a Computer object) for the Solaris host in Active Directory and generates a random password for this account</li>
<li>configures the Solaris host as a Kerberos client of the Active Directory domain controller by using the <code>/etc/krb5/krb5.conf</code> file</li>
<li>configures the <code>/etc/krb5/krb5.keytab</code> file on the Solaris host by using the keys for the machine account (also called host credentials)</li>
</ul>
<p>Execute adjoin script with following options:<br />
<code>./adjoin -d &lt;domain_name&gt; -p &lt;administrator_principal&gt; -f -x</code><br />
where <code>-f</code> to delete any pre-existing computer account for this host and <code>-x</code> to debug output.</p>
<p>If your domain if geographically distributed with a lot of domain controllers (DC), script can detect inappropriate controllers. Just before entering admin password, check prepared <code>adjoin-krb5.conf.XXXXXX</code> file in the <code>/tmp</code> folder and remove unnecessary controllers from it.</p>
<p>Adjoin script can stop work with pkcs11_kernel.so syntax error on some SUN servers:<br />
<code>+ ./adjoin[859]: /usr/lib/security/$ISA/pkcs11_kernel.so:: syntax error</code><br />
Then all you need is just to temporary rename this file and execute adjoin again<br />
<code>mv /usr/lib/security/$ISA/pkcs11_kernel.so /usr/lib/security/$ISA/pkcs11_kernel.so.orig</code><br />
when adjoin finished successfully, rename it back</li>
<li>Run <strong>ldapsearch</strong> and <strong>klist</strong> to check Kerberos<br />
<code>ldapsearch -R -T -h dc1.xxxxxx.com -o authzid= -o mech=gssapi -b CN=Computers,DC=xxxxxx,DC=com -s sub cn=&lt;computer_name&gt;</code><br />
<code>klist</code><br />
<code>klist -e -k /etc/krb5/krb5.keytab</code></li>
<li>Enable dns client and cache daemons<br />
<code>svcadm enable /network/dns/client</code><br />
<code>svcadm enable /system/name-service-cache</code></li>
<li>In the <code>/etc/nsswitch.ldap</code> file <strong>dns</strong> and <strong>files</strong> must be specified for <strong>hosts</strong> and <strong>ipnodes</strong><br />
<code>...<br />
hosts:      dns files<br />
ipnodes:    dns files<br />
...</code></li>
<li>Set up a server as a client of an LDAP. Execute <strong>ldapclient</strong><br />
<code>ldapclient -v manual \<br />
-a credentialLevel=self \<br />
-a authenticationMethod=sasl/gssapi \<br />
-a defaultSearchBase=dc=xxxxxx,dc=com \<br />
-a defaultSearchScope=sub \<br />
-a domainName=xxxxxx.com \<br />
-a defaultServerList="dc1.xxxxxx.com dc2.xxxxxx.com dc3.xxxxxx.com" \<br />
-a attributeMap=passwd:gecos=cn \<br />
-a attributeMap=passwd:homedirectory=unixHomeDirectory \<br />
-a objectClassMap=group:posixGroup=group \<br />
-a objectClassMap=passwd:posixAccount=user \<br />
-a objectClassMap=shadow:shadowAccount=user \<br />
-a serviceSearchDescriptor="passwd:ou=Accounts,ou=European office,dc=xxxxxx,dc=com?sub;ou=Accounts,ou=American Office,dc=xxxxxx,dc=com?sub" \<br />
-a serviceSearchDescriptor=group:ou=Groups,dc=xxxxxx,dc=com?sub</code><br />
ldapclient should finish without errors. To check use <code>ldapclient list</code>
</li>
<li>Edit the <code>/etc/nsswitch.conf</code> file: <strong>files</strong> and <strong>ldap</strong> must be specified for <strong>passwd</strong> and <strong>group</strong> only<br />
<code>...<br />
passwd:     files ldap<br />
group:      files ldap<br />
hosts:      dns files<br />
ipnodes:    dns files<br />
networks:   files<br />
protocols:  files<br />
...</code><br />
remove ldap from everywhere else</li>
<li>Restart LDAP client<br />
<code>svcadm restart /network/ldap/client</code></li>
<li>Add <strong>pam_krb5.so.1</strong> in the <code>/etc/pam.conf</code> file<br />
<code>...<br />
login   auth sufficient         pam_krb5.so.1<br />
krlogin auth required           pam_krb5.so.1<br />
krsh    auth required           pam_krb5.so.1<br />
ktelnet auth required           pam_krb5.so.1<br />
other   auth sufficient         pam_krb5.so.1<br />
other   account required        pam_krb5.so.1<br />
other   password sufficient     pam_krb5.so.1<br />
...</code></li>
</ol>
<p>To ensure that users could login on the host under their AD accounts, accounts in AD must have following additional attributes:<br />
<strong>uid</strong> the same as sAMAccountName<br />
<strong>uidNumber</strong> unique number<br />
<strong>gidNumber</strong> number<br />
<strong>unixHomeDirectory</strong> for example <em>/tmp</em><br />
<strong>loginShell</strong> for example <em>/usr/bin/bash</em> or <em>/bin/false</em></p>
<p>To check it use <strong>getent</strong> or <strong>ldapsearch</strong><br />
<code>getent passwd &lt;uid&gt;<br />
ldapsearch -R -T -h dc1.xxxxxx.com -b "ou=Accounts,ou=American Office,dc=xxxxxx,dc=com" -o mech=gssapi -o authzid='' "uid=&lt;uid&gt;"</code></p>
<p>If you would like read more: <a href="http://wikis.sun.com/display/BigAdmin/Using+Kerberos+to+Authenticate+a+Solaris+10+OS+LDAP+Client+With+Microsoft+Active+Directory">link</a> to SUN&#8217;s article &#8220;Using Kerberos to Authenticate a Solaris 10 OS LDAP Client With Microsoft Active Directory&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://tibcoadmin.com/sun/solaris/how-to-add-solaris-10-server-into-ms-active-directory-domain/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>

