{"id":387,"date":"2013-07-10T07:32:28","date_gmt":"2013-07-10T14:32:28","guid":{"rendered":"http:\/\/blog.ls-al.com\/?p=387"},"modified":"2013-07-10T07:34:41","modified_gmt":"2013-07-10T14:34:41","slug":"using-bash-for-root-user-on-solaris-10","status":"publish","type":"post","link":"https:\/\/blog.ls-al.com\/using-bash-for-root-user-on-solaris-10\/","title":{"rendered":"Using Bash for root user on Solaris 10"},"content":{"rendered":"

By default Solaris 10 use \"\/\" as root's home directory and plain sh as a shell. \u00a0If you want to change to using the \/root directory as home and bash as a shell for more consistency with Solaris 11 you can do the following.<\/p>\n

\r\n...\r\nOracle Corporation SunOS 5.10 Generic Patch January 2005\r\n\r\nroot@ldom2:~# grep root \/etc\/passwd\r\nroot:x:0:0:Super-User:\/root:\/usr\/bin\/bash\r\n\r\nroot@ldom2:~# mkdir \/root\r\nroot@ldom2:~# pwd\r\n\/root\r\n\r\nroot@ldom2:~# cat .profile\r\n#\r\n# Simple profile places \/usr\/bin at front, followed by \/usr\/sbin.\r\n#\r\n# Use less(1) or more(1) as the default pager for the man(1) command.\r\n#\r\nexport PATH=\/usr\/bin:\/usr\/sbin\r\n\r\nif [ -f \/usr\/bin\/less ]; then\r\n export PAGER="\/usr\/bin\/less -ins"\r\nelif [ -f \/usr\/bin\/more ]; then\r\n export PAGER="\/usr\/bin\/more -s"\r\nfi\r\n\r\n#\r\n# Define default prompt to <username>@<hostname>:<path><"($|#) ">\r\n# and print '#' for user "root" and '$' for normal users.\r\n#\r\n# Currently this is only done for bash\/pfbash(1).\r\n#\r\n\r\ncase ${SHELL} in\r\n*bash)\r\n typeset +x PS1="\\u@\\h:\\w\\\\$ "\r\n ;;\r\nesac\r\n\r\nroot@ldom2:~# cat .bashrc\r\n#\r\n# Define default prompt to <username>@<hostname>:<path><"($|#) ">\r\n# and print '#' for user "root" and '$' for normal users.\r\n#\r\n\r\ntypeset +x PS1="\\u@\\h:\\w\\\\$ "\r\n\r\n<\/pre>\n

Logout and back in and your shell should be bash and prompt fixed as well.<\/p>\n","protected":false},"excerpt":{"rendered":"

By default Solaris 10 use “\/” as root’s home directory and plain sh as a shell. \u00a0If you want to<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,14],"tags":[],"class_list":["post-387","post","type-post","status-publish","format-standard","hentry","category-bash","category-solaris"],"_links":{"self":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/387","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/comments?post=387"}],"version-history":[{"count":0,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/387\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/media?parent=387"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/categories?post=387"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/tags?post=387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}