Solaris command related issues.

1 view
Skip to first unread message

Atiqur Rahman

unread,
Nov 12, 2008, 8:56:39 AM11/12/08
to sun...@googlegroups.com
You may have faced such problems in Solaris.

# gcc
ksh: command not found!
# g++
ksh: command not found!

By default Solaris has gcc, g++ etc gnu-utils installed in /usr/sfw/bin/

What you need is include the path.
1st way,
     To export a path permanently modify path variable in /etc/profile which will look like this,
           /usr/bin:/usr/openwin/bin:/usr/ucb:/usr/sfw/bin:/usr/ccs/bin:/opt/csw/bin  (Including most useful paths)

2nd way,
    To export a path temporarily type like this,
          export PATH=$PATH:/usr/bin:/usr/openwin/bin:/usr/ucb:/usr/sfw/bin:/usr/ccs/bin:/opt/csw/bin

3rd way,
    Append the same line in ~/.bashrc

Saint Linux

unread,
Dec 6, 2008, 4:58:20 AM12/6/08
to Unix.Solaris
Mounting drives (fat or fat32 filesystem)
====================================
This is done using mount command
# mount -F pcfs /dev/dsk/c0d0p0:C /mnt/

If your drive a secondary or slave one you may have to try c0d1p0

Atiqur Rahman

unread,
Dec 6, 2008, 5:54:42 AM12/6/08
to Unix.Solaris
Creating an user account in Solaris
================================
If you have switched from Linux you will find it hard to create an
user account by only applying,
# useradd yourName

In Linux when loggin in it would create the directory by default for
the user in /home and then log you in there. In Solaris this the
mistake most people(begineers) do. Use the following syntax to add an
user account.

# useradd -G groupname -m -d /home/arn -s /bin/bash userName

-m switch creates the directory for new user if it does not exist. If
you don't use it you'll not be able to login GUI.

For example, I have used
# useradd -G root -m -d /home/Atique -s /bin/bash Atique

If you need to delete an user account it's same(use userdel).

Related Links:
http://docs.sun.com/app/docs/doc/816-5166/useradd-1m?l=en&a=view&q=useradd
http://docs.sun.com/app/docs/doc/816-5166/userdel-1m?l=en&a=view&q=userdel

Atiqur Rahman

unread,
Dec 6, 2008, 6:24:39 AM12/6/08
to Unix.Solaris
Changing to your favourite shell
================================

To know currently what shell you are using type:
# echo $0

You can use a shell for once using this command (for example bash)
# /bin/bash

To change your shell permanently modify /etc/passwd. In my Solaris it
looks like this:

##############################################################
root:x:0:0:Super-User:/:/sbin/sh
daemon:x:1:1::/:
bin:x:2:2::/usr/bin:
sys:x:3:3::/:
adm:x:4:4:Admin:/var/adm:
lp:x:71:8:Line Printer Admin:/usr/spool/lp:
uucp:x:5:5:uucp Admin:/usr/lib/uucp:
nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/usr/lib/uucp/uucico
smmsp:x:25:25:SendMail Message Submission Program:/:
listen:x:37:4:Network Admin:/usr/net/nls:
gdm:x:50:50:GDM Reserved UID:/:
webservd:x:80:80:WebServer Reserved UID:/:
postgres:x:90:90:PostgreSQL Reserved UID:/:/usr/bin/pfksh
svctag:x:95:12:Service Tag UID:/:
nobody:x:60001:60001:NFS Anonymous Access User:/:
noaccess:x:60002:60002:No Access User:/:
nobody4:x:65534:65534:SunOS 4.x NFS Anonymous Access User:/:
messagebus:x:101:100:DBus daemon user:/opt/csw/share:/bin/sh
Atique:x:100:1::/home/Atique:/bin/bash
##############################################################

I have modified Atique:x:100:1::/home/Atique:/bin/sh (last line) to /
bin/bash to get bash shell by default. In case of root be careful you
see the line is:

root:x:0:0:Super-User:/:/sbin/sh

So if you change to
root:x:0:0:Super-User:/:/sbin/bash
It won't work(no bash in sbin). You have to change like this:
root:x:0:0:Super-User:/:/bin/bash

Atiqur Rahman

unread,
Dec 6, 2008, 6:39:41 AM12/6/08
to Unix.Solaris
Process Status command details
=================================
To display process status owned by current user type
# ps -a

To display all running processes (same as ps -e)
# ps -A

To display full detailed list of processes
# ps -f

Display process ID along process group ID
# ps -j

ps -aux is not supported on Solaris.

Related Links:
http://docs.sun.com/app/docs/doc/816-5165/ps-1?l=en&a=view&q=ps
http://unixhelp.ed.ac.uk/CGI/man-cgi?ps

Atiqur Rahman

unread,
Dec 26, 2008, 4:31:15 AM12/26/08
to Unix.Solaris
I posted this problem on an UseNet group.

=========================================================
bash$ c++ test.c
cc1plus: /usr/local/include: Permission denied

bash$ cc test.c
/usr/ucb/cc: language optional software package not installed

bash$ g++ test.c
cc1plus: /usr/local/include: Permission denied

bash$ cat test.c
#include <stdio.h>

int main () {
printf("Test\n");
return 0;

}

bash$ echo $PATH
/usr/bin:/usr/openwin/bin:/usr/ucb:/usr/sfw/bin:/opt/sfw/bin

I'm using Solaris 10 update 6. All these are coming when I apply these
commands as regular user. Everything's ok with root user.
========================================================

They gave me perfect solution that is to applying these commands,

chmod a+r usr/local
chmod a+x usr/local

And the problem is solved. So complex problems seems to have simple
solutions!

Related Links:
http://groups.google.com/group/comp.unix.solaris/browse_thread/thread/a61d85ea678aa009?hl=en

Atiqur Rahman

unread,
Jan 30, 2009, 8:26:40 AM1/30/09
to Unix.Solaris
Disabling unnecessary Solaris Services
================================

Services that you may want to disable once the Zone has booted are
listed below. This procedure as the effect of locking the zone down
and making it more secure.

svcadm disable ftp
svcadm disable telnet

svcadm disable ssh (left this on if you need ssh)

svcadm disable sendmail (left this on for Drupal CMS sending emails)

svcadm disable finger
svcadm disable rlogin
svcadm disable nfs/client
svcadm disable nfs/status
svcadm disable nfs/nlockmgr
svcadm disable rpc/bind
svcadm disable rpc/gss
svcadm disable rpc/rstat
svcadm disable rpc/rusers
svcadm disable rpc/smserver
svcadm disable shell:default (left this on for us)
svcadm disable svc:/network/cde-spc:default
svcadm disable svc:/application/graphical-login/cde-login:default
(Don't disable this service if you want GUI running!)

svcadm disable inetdsvcadm disable rpc-100235_1/
rpc_ticotsord:defaultsvcadm disable rpc-100068_2-5/rpc_udp:default
svcadm disable rpc-100083_1/rpc_tcp:default
svcadm disable x11/xfs
svcadm disable font/fc-cache
(Be careful before disabling, this service is required by graphical-
login/cde-login:default)
Reply all
Reply to author
Forward
0 new messages