Posts Tagged ‘Solaris 10’

Using VI Editor (Visual Editor)

January 17th, 2021, posted in Linux OS, Solaris
Share

VI Editor (Visual Editor)


You must be familiar with notepad in windows which is used to edit a file. Like-wise we have VI editor in UNIX, LINUX & SOLARIS OS used widely for editing files.
However, Unlike notepad it is little tricky to use. I wish the VI editor would have been developed by Bill gates rather than Bill Joy.
Anyways, guys we don’t have any other option rather than getting aware of all these commands so that we become proficient in working with the VI Editor.

Understanding different modes in VI Editor:
There are three different modes in VI editors:
1. Command Mode
2. Insert/input Mode
3. EX mode

By default when you will open the VI editor, it will be in command mode. In the following sections we will see:
1. How to switch from one mode to another?
2. What are the different VI Commands that we can use in these modes.


Command Mode : 
This is default mode of the VI editor. In this mode we can delete, change, copy and move text.

VI Navigation Commands:

Key
Use
j(or down arrow) To move the cursor to the next line (move down) 
k(or up arrow) To move the cursor to the previous line (move up) 
h(or left arrow)  To move left one character
l(or right arrow) To move right one character
H To move the cursor to current page beginning of the first line.
G To move the cursor to current page beginning of the last line.
b To move the cursor previous word first character
e To move the cursor next word last character
w To move the cursor to next word first character
^ Go to beginning of line 
0 Go to beginning of line
$ Go to the end of the line
CTRL+F forward 1 screen
CTRL+B backward 1 screen
CTRL+D down (forward) 1/2 screen
CTRL+U up (backward) 1/2 screen

Copy & Paste:

Key Use
y+w  To copy rest of the word from current cursor position. 
n+y+w  To copy n number of words from the current cursor position.
y+y To copy a line
n+y+y To copy n lines
p(lowerCase) To paste a copied words/lines after the current position of the cursor
P(uppercase) To paste a copied words/lines before  the current position of the cursor

Deletion:

Key
Use
x deletes a single character 
n+X  To delete n number of characters from the cursor position in a line.
d+w To delete rest of a word from current cursor position
n+d+w  To delete n  number of words from the cursor position in a line
d$ Delete rest of line from current cursor position
D Delete rest of line from current cursor position
d+d To delete an entire line
n+d+d To delete n lines from current cursor position


Few More Important Command Mode VI commands:

Key
Use
u Undo changes (only one time) 
U Undo all changes to the current line 
~ To change the case of the letter
ZZ Saves the changes and quits the vi editor 

Input or Insert Mode: In this mode we can insert text into the file. We can enter the insert mode by pressing following keys in command mode:

Key
Use
i Inserts the text before the cursor 
I Inserts the text at the beginning of the line 
o Opens a new blank line below the cursor
O Opens a new blank line above the cursor
a Appends text after the cursor
A Appends the text after the line
r replace the single character with another character 
R replace a entire line
Esc To return to command mode

 Last line mode or Collan Mode : This is used for advance editing commands. To access the last line mode enter “:” while in command mode.

Key
Use
: To get to collan mode(This need to be entered every time a user wants to use collan mode command)
:+set nu Shows line numbers
:+set nonu Hides line numbers
:+enter+n  Moves the cursor to the n line
:+/keyword  To move the cursor to the line starting with the specific keyword
:+n+d Deletes nth line
:+5,10d Delete line from 5th line to 10th line
:+7 co 32 Copies 7th line and paste in 32nd line
:+10,20 co 35 Copies lines from 10th line to 20th line and paste it from 35th line

:+%s/old_text/new_text/g  Searches old string and replaces with the new string
:+q+! Quits vi editor without saving
:+w Saves the file with changes by writing to the disk
:+w+q Save and exit the vi editor
:+w+q+! Save and quit the VI Editor forcefully.
1,$s/$/” -type=Text_to_be_appended Append text at the end of the line

Using VI editor Command:

vi options <file name>
The options are discussed below:
-r : To recover a file from system crash while editing.
-R : To open a file in read only mode.

 

Viewing Files in Read Only Mode:
view <file name>
This is also used to open the file in read only mode. To exit type ‘:q‘ command.

 

Automatic Customization of a VI session:
1. Create a file in the user’s home directory with the name .exrc
2. enter the set variables without preceding colon
3. Enter each command in one line.
VI reads the .exrc file each time the user opens the vi session.
Example:
#cd ~
#touch .exrc
#echo “set nu”>.exrc
#cat .exrc
set nu
#
In the above example we have used set line number command. So whenever the user opens the vi session, line number is displayed.
I know its nearly impossible to keep all the above commands in mind, even I don’t have, but as we keep practicing, we will be knowing most of them.
Share

Getting Started with Solaris 10

December 28th, 2020, posted in Solaris
Share

Must to know keywords: Before kick starting the SOLARIS study lets be aware of few important keywords and FACTS about the SOLARIS OS.

Process: A process is a program running or being executed on the computer.Every process has a unique identifier number known as process ID.

Daemon: This would be something new to Window’s user. A daemon is also a process which often runs continuously as long as the system is up.This daemons runs in background. The daemons starts when the system starts and ends with the shutdown.

Kernel: Kernel is the heart of operating system. Its the core defining program for the Operating system.

Shell:
Shell is the program through which a user interacts with the kernel. It acts as a wrapper between the user and kernel.When a user issues a command on the shell, the shellgoes to kernel and gets back the required information to the user.Shell Script: We can write a series of shell command in a file and execute them. This file is known as shell script.


A brief Introduction to SOLARIS OS:
Solaris from SUN Microsystems, founded in February 1982 by Bill Joy (among others), who was previously involved in the development of BSD 4.1. It was the improved version of BSD 4.1 that was released by SUN as SunOS in 1983. It was based on SPARC (Scalable Processor Architecture).

In the year 1996 the Sun Solaris was introduced both for the SPARC and X86 based architecture. It had both CDE (Common Desktop Environment and JDS (Java Desktop System).
Difference b/w SPARC and X86 based machines:
SPARC
X86
It uses RISC (Reduced Instruction Set Computing) It uses CISC (Complex Instruction Set Computing)
It uses SCSI(Smaller Computing System Interface). The benefits of SCSI are: 1. Increase performance
2. Increase data availability
3. Hot Swappable
It uses IDE(Integrated Device Electronic)
Types of Chips in SPARC
  1. PROM (Programmable Read Only Memory)It is an 8kb chip which is non-pluggable. It understands only hardware commands & it does not understand OS related commands. The main purpose of PROM chip is to configure the system h/w and to set boot priorities.To go to Open Boot Prompt (OBP) or OK prompt: press STOP (key) + A
  1. NV RAM (Non-Volatile RAM chip)It is also a chip which is pluggable but it contains unique hardware ID which cannot duplicate to other machines.
    NV RAM chips contains complete information about the PROM chip like:
  1. Prom release and version
  2. Host ID
  3. MAC Address
  4. RAM size
Different releases of SOLARIS:
SOLARIS 10 beta released in the year 2004
SOLARIS 10 OEM released in the year 2005
SOLARIS 10 New features released in the year 2006
SOLARIS 11 was released in the year 2011
New Features in SOLARIS 10
  1. Zones: It is nothing but virtual OS something like virtual OS under Vmware. The main purpose of ZONES is to reduce the h/w costs and to utilize the CPU and hardware resource effectively. SOLARIS supports maximum 8192 virtual OS. We can install only SOLARIS OS in virtual OS.
  2. SMF: The main purpose of it is to increase the performance of the server by enabling the services which we required and by disabling the services which we don’t require.
  3. ZFS: It is advance file system which supports maximum 16 Exabytes. It is OS dependent.

Logging into Solaris Desktop Environment:
When a user logins into the Solaris Desktop environment, the login screen appears have following fields:
username:
help:
options:
Start Over:
Ok
Various login options: 
When a user selects the options button at login screen, a list with menu appears:
Language: It is used to change the language option.
Session
CDE (Common Desktop Environment)
Java Desktop System, Release 3
User’s Last Desktop: It displays the desktop used at the end of                                                                                             previous session.
Failsafe session: It displays the terminal window instead of starting a desktop session. This can be used when a user has trouble login in single X-terminal window. It is available even when command line logging option is not available.
Remote Login: It is used to connect to remote system.
Enter Host Name …
Choose Host List
Command line login : 
This is used to work in UNIX command environment. Type exit to get out of the command line environment. The desktop login screen re-appears after 30 seconds.
Reset login screen
It is used to reset desktop environment login screen.
Changing User Password:
In Solaris OS, the user password must have following characteristics:
1. Password length: 6-8 characters in length.
2. It contains at least 2 alphabetic characters & must contain at least one numeric or special character such as semicolon(;), an asterisk(*), or a dollar sign($).
3. Differ from the user’s login name.
4. Differ from previous password by at least three characters
5. Contain spaces(optional)
6. Not to be reverse of the user’s login name.
Note: The above password requirements do not apply to the system administrator’s root account.
To change the password perform following steps:
1. Run the passwd command.
2. Type the existing password at the Enter existing password prompt.
3. Type the new password at the new password prompt.
4. Re-enter the new password again at the Re-enter new password prompt.
Securing Desktop Environment session:
1. Locking screen: click Launch -> Lock Screen.
2. Exiting session:Click Launch -> Log out -> OK
Customizing desktop session:
To change desktop background:
Launch -> Preferences -> Desktop Preferences -> Display
To customize workspace:
Move mouse to Workspace switcher area in front of pannel -> Right click on workspace –> Select preferences 
Managing files:
Double click on Documents icon on desktop
Launch -> Open Recent -> Open Documents Folder

Using Online Documentation:
The Online reference manual(man) pages provide detailed descriptions if Solaris commands and how to use them. It explains detained information about the usage of an command.
Syntax: man options command
Example:# man ls

The above example gives detailed information about the ls command.

Scrolling in man pages:
Scrolling Keys
Action
Space bar Displays the next screen of a man page
Return Displays the next line of a man page
b Moves back one full screen
/pattern Searches forward for a pattern
n Finds the next occurrence of pattern after /pattern command is used
h Provides description of all scrolling capabilities
q Quits the man page and returns to shell
Searching man pages:

man intro 
It is used to view descriptive information about sections contained in the man pages.
man -s number <command>|<filename>

This is used for looking a specific section of man pages .

man -l command

This is used to list the man pages that relate to the same command.

man -k keyword
It searches all the man pages containing the keyword specified.
Example:
man -k clear
The above command finds the man page that contains the keyword ‘clear’.

man -M path
Specify an alternate manpath to use. By default, man uses manpath derived code to determine the path to search. This option overrides the $MANPATH environment variable and causes option -m to be ignored.

Preformatted man pages:

The catman command is used to create preformatted man pages, which is faster to access, however they occupy more space.  catman  makes  use of the index database cache(windex) associated with each hierarchy to determine which files need to be formatted.
#catman -w
The above command configures windex database for man pages.

The online product documentation can be found from the link:

Few FAQs : You may skip this section if not interested.
DMP(Dynamic Multipathing)
This is miscellaneous information and you can skip if not interested. In computer data storage technology field, dynamic multipathing (DMP) is a multipath I/O enhancement technique that balances input/output (I/O) across many available paths from the computer to the storage device to improve performance and availability. The name was introduced with Veritas Volume Manager software.
The DMP utility does not take any time to switch over, although the total time for failover is dependent on how long the underlying disk driver retries the command before giving up.
IDE Controller (Integrated Device Controller):
The IDE controller is used mostly in X86 based system.
There can be maximum two IDE controller attached to a Motherboard with each port being able to control two IDE devices, for a total of four. So totally 4 device can be connected via IDE Controller in a system.
Following example explains the same:
c0d0 – Primary Master
c0d1 – Primary Slave
c1d0 – Secondary Master
c1d1 – Secondary Slave
There can be maximum of 10 slices in an x-86 based machine. Following example illustrate the same:
c0d0s0, c0d0s1,………c0d0s9
c0d1s0, c0d1s1,………c0d1s9
c1d0s0, c1d0s1,………c1d0s9
c1d1s0, c1d1s1,………c1d1s9
Note: ‘c’ refers to controller, ‘d’ refers to disk and ‘s’ refers to slice.
SCSI Controller (Small Computing System Interface):
There are three types of SCSI controller:
1. Narrow SCSI
It supports maximum of 7-device and only 8 slices
Example:         c0t0d0s0, c0t0d0s1,……….c0t0d0s7
                        c0t1d0s0, c0t1d0s,………… c0t1d0s7
                        .
                        .
                        .
                        c0t6d0s0, c0t6d0s1,……….. c0t6d0s7
Note: ‘t’ refers to target.
2. Wide SCSI & 3. Ultra SCSI
It supports maximum of 15 devices and 8 logical partitions.
The difference between Wide & Ultra SCSI is that the performance is better in Ultra SCSI.
Share

Creating Partition Space In Sun Solaris 10

November 3rd, 2019, posted in Solaris
Share

Open  console and start with this :Oracle Database,DBA immam,DBA imam,oracle issues,oracle database,oracle clone issues,oracle clone,oracle autoconfig,oracle autoconfig issues

bash-3.00# format

It gives the following output.

Searching for disks…done
AVAILABLE DISK SELECTIONS:
0. c0d0 <DEFAULT cyl 2085 alt 2 hd 255 sec 63>
/[email protected],0/[email protected],1/[email protected]/[email protected],0
Specify disk (enter its number):


Check out, AVAILABLE DISK SELECTIONS. Now, I have only one disk (c0d0). Select the ‘0’ (Zero) no. disk to make partitioned in it.

Specify disk (enter its number): 0

It will give the following output.

selecting c0d0
Controller working list found
[disk formatted, defect list found]
Warning: Current Disk has mounted partitions.
/dev/dsk/c0d0s0 is currently mounted on /. Please see umount(1M).
/dev/dsk/c0d0s1 is currently used by swap. Please see swap(1M).
/dev/dsk/c0d0s3 is currently mounted on /mytest. Please see umount(1M).
FORMAT MENU:
disk          – select a disk
type         – select (define) a disk type
partition – select (define) a partition table
current    – describe the current disk
format     –  format and analyze the disk
fdisk         – run the fdisk program
repair      – repair a defective sector
show       – translate a disk address
label       – write label to the disk
analyze – surface analysis
defect    – defect list management
backup   – search for backup labels
verify     – read and display labels
save        – save new disk/partition definitions
volname – set 8-character volume name
!<cmd> – execute <cmd>, then return
quit
format>

Now enter ‘p’ (Partition) to initiate partitioning procedure in it.

format> p

It will give following output :

PARTITION MENU:
0 – change `0′ partition
1 – change `1′ partition
2 – change `2′ partition
3 – change `3′ partition
4 – change `4′ partition
5 – change `5′ partition
6 – change `6′ partition
7 – change `7′ partition
select – select a predefined table
modify – modify a predefined partition table
name – name the current table
print – display the current table
label – write partition map and label to the disk
!<cmd> – execute <cmd>, then return
quit
partition>

To see existing partitions, issue ‘p’ (print).

partition> p

It will give following output.

Current partition table (original):
Total disk cylinders available: 2085 + 2 (reserved cylinders)

Part      Tag     Flag      Cylinders         Size               Blocks
0       root    wm       3 – 1308       10.00GB          (1306/0/0)     20980890
1       swap    wu    1309 – 1570        2.01GB          (262/0/0)       4209030
2     backup    wm       0 – 2084       15.97GB         (2085/0/0)    33495525
3 unassigned    wu    1571 – 1672      800.11MB    (102/0/0)   1638630
4 unassigned    wm                     0               0                      (0/0/0)           0
5 unassigned    wm                     0               0                      (0/0/0)           0
6 unassigned    wm                     0               0                      (0/0/0)           0
7 unassigned    wm                     0               0                      (0/0/0)           0
8       boot    wu                          0 –    0        7.84MB    (1/0/0)       16065
9 alternates    wu                     1 –    2       15.69MB    (2/0/0)       32130

partition>

Checkout the table. No 0, 1, 2,8 and 9 is not usable. no. 3 is not usable as already created a partition there. 4,5,6 and 7 is available to make partition. So, I have selected 4.

partition> 4

It will give following output :

Part      Tag           Flag     Cylinders        Size            Blocks
4 unassigned    wm       0               0         (0/0/0)           0

Enter partition id tag[unassigned]:

Keep partition id and permission flags empty.

Enter partition id tag[unassigned]:
Enter partition permission flags[wm]:
Enter new starting cyl[0]:

Now, check previous partition of no. 4. It is number 3. Its Cylinders count ended at 1672. So, we will start from 1673. (If there is no no. 3 that i created previously, then we would have look for part no. 1. Not 2, because it is not usable, it represents whole disk size).

Now enter 1673

Enter new starting cyl[0]: 1673

and partition size 500mb.

Enter partition size[0b, 0c, 1673e, 0.00mb, 0.00gb]: 500mb

Now enter ‘label’ to confirm your partition.

partition> label
Ready to label disk, continue? y

Now, again see your partitioning summary.

partition> p
Current partition table (unnamed):
Total disk cylinders available: 2085 + 2 (reserved cylinders)

Part      Tag     Flag      Cylinders         Size               Blocks
0       root    wm       3 – 1308       10.00GB          (1306/0/0)     20980890
1       swap    wu    1309 – 1570        2.01GB          (262/0/0)       4209030
2     backup    wm       0 – 2084       15.97GB         (2085/0/0)    33495525
3 unassigned    wu    1571 – 1672      800.11MB    (102/0/0)   1638630
4 unassigned      wm    1673 – 1736     502.03MB   (64/0/0) 1028160
5 unassigned    wm                     0               0                      (0/0/0)           0
6 unassigned    wm                     0               0                      (0/0/0)           0
7 unassigned    wm                     0               0                      (0/0/0)           0
8       boot    wu                          0 –    0        7.84MB    (1/0/0)       16065
9 alternates    wu                     1 –    2       15.69MB    (2/0/0)       32130

Well, its done.

Now, issue ‘q’ to exit partition and again ‘q’ to exit format.

partition> q
FORMAT MENU:
disk – select a disk
type – select (define) a disk type
partition – select (define) a partition table
current – describe the current disk
format – format and analyze the disk
fdisk – run the fdisk program
repair – repair a defective sector
show – translate a disk address
label – write label to the disk
analyze – surface analysis
defect – defect list management
backup – search for backup labels
verify – read and display labels
save – save new disk/partition definitions
volname – set 8-character volume name
!<cmd> – execute <cmd>, then return
quit
format> q
bash-3.00#

Then, format file system.

bash-3.00# newfs /dev/rdsk/c0d0s4

Result :

bash-3.00# newfs /dev/rdsk/c0d0s4
newfs: construct a new file system /dev/rdsk/c0d0s4: (y/n)? y
Warning: 4032 sector(s) in last cylinder unallocated
/dev/rdsk/c0d0s4:           1028160 sectors in 168 cylinders of 48 tracks, 128 sectors
502.0MB in 13 cyl groups (13 c/g, 39.00MB/g, 18624 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 80032, 160032, 240032, 320032, 400032, 480032, 560032, 640032, 720032,
800032, 880032, 960032

Now, we have to mount this partition.

Create a directory in root directory.

bash-3.00# cd /
bash-3.00# mkdir oracle

Our partition is at ‘/dev/dsk/c0d0s4’. We will mount it to previously created oracle directory.

bash-3.00# mount /dev/dsk/c0d0s4 /oracle

Check newly created partition.

bash-3.00# cd /oracle/
bash-3.00# ls
lost+found
bash-3.00# df -h
Filesystem                         size   used  avail capacity  Mounted on
/dev/dsk/c0d0s0        9.9G   3.4G   6.4G    35%    /
/devices                             0K     0K     0K     0%    /devices
ctfs                                 0K     0K     0K     0%    /system/contract
proc                                 0K     0K     0K     0%    /proc
mnttab                               0K     0K     0K     0%    /etc/mnttab
swap                               2.3G   548K   2.3G     1%    /etc/svc/volatile
objfs                                0K     0K     0K     0%    /system/object
sharefs                              0K     0K     0K     0%    /etc/dfs/sharetab
fd                                   0K     0K     0K     0%    /dev/fd
swap                               2.3G   136K   2.3G     1%    /tmp
swap                               2.3G    32K   2.3G     1%    /var/run
/dev/dsk/c0d0s3        752M   1.0M   698M     1%    /mytest
/dev/dsk/c0d0s4        472M   1.0M   424M     1%    /oracle
bash-3.00#

To make it permanent. you need to edit the file ( /etc/vfstab ) {stands for Virtual File System Table} using command:

vi /etc/vfstab

now : enter your new partition information in the last line device to mount device

/dev/dsk/c0d0s4 /dev/rdsk/c0d0s4 /oracle ufs 1 yes –
Share

Segmentation Fault (core dumped)

September 4th, 2018, posted in Solaris
Share

Segmentation Fault or Segmentation Fault (core dumped)

Cause

Segmentation faults usually come from a programming error. This message is usually accompanied by a core dump, except on read-only file systems.

Action

To see which program produced a core(4) file, run either the file(1) command or the adb(1) command. The following examples show the output of the file(1) and adb(1) commands on a core file from the dtmail program.

$ file core
core: ELF 32-bit MSB core file SPARC Version 1, from `dtmail'
$ adb core
core file = core -- program `dtmail'
SIGSEGV  11: segmentation violation
^D      (use Control-d to quit the adb rogram)

 

Segmentation Fault (core dumped) or Segmentation Fault,Segmentation Fault (core dumped), Segmentation Fault,core dumped,solaris,solaris 10,Solaris Common Messages and Troubleshooting Guide,Solaris Common Messages,Troubleshooting Guide,Solaris Troubleshooting,

Segmentation Fault (core dumped) or Segmentation Fault,Segmentation Fault (core dumped), Segmentation Fault,core dumped,solaris,solaris 10,Solaris Common Messages and Troubleshooting Guide,Solaris Common Messages,Troubleshooting Guide,Solaris Troubleshooting ,

Share

Chmod With Examples Along With Quick Reference

July 1st, 2018, posted in Solaris
Share

What is chmod ?

chmod ( Change Mode ) is a command line utility in Unix , Linux and other Unix like systems to change the read, write, execute permissions of a file for owner , group and others.

How to use chmod?

Chmod command is used in two ways :
1. Using octal value & position : Sets the permission for owner, group and others with octal values , 4 for read , 2 for write , 1 for execute and any sum of these number to get cumulative permissions.

chmod syntax using octal mode
chmod [OPTION] MODE FILE

2. Using symbolic values to add, remove the file permission
u for user , g for group , o for others a for all ; r for read , w for write , x for execute , + , – & = for adding , removing and assigning r w x permissions.

chmod syntax for symbolic values
chmod [OPTION] MODE1,MODE2 FILE

3. chmod options

-R – Recursively change the permissions in the file under the directory.

chmod examples using octal mode :

  • First column shows the chmod command ,
  • second column shows how the value is calculated for the permission
  • last columns of owner, group, others shows individual octal values and actual bit set on file as seen by ls -l.
  • For setting any other permission combination for owner, group & other , pick corresponding value from each column and use with chmod command , for example chmod 264 file , chmod 400 file , chmod  755 file etc.
OWNER GROUP OTHERS
Permissions Value octal value & bit set
rwx
Read write Execute
$chmod 777 file
4+2+1 7
rwx
7
rwx
7
rwx
rw
Read & Write
$chmod 666 file
4+2 6
rw_
6
rw_
6
rw_
rx
Read & Execute
$chmod 555 file
4+1 5
r_ x
5
r_ x
5
r_ x
r
Read only
$chmod 444 file
4 4
r_ _
4
r_ _
4
r_ _
w
Write only
$chmod 222 file
2 2
_w_
2
_w_
2
_w_
x
Execute only
$chmod 111 file
1 1
_ _ x
1
_ _ x
1
_ _ x

chmod examples using symbolic mode :

Symbol are used to assign the permissions :

  • u – user , g – group,  o – others ,  a – all
  • +  to add permission  ,    to remove permission ,  = to assign permission
  • r w x   is used for read , write,execute ,  s  is used to set the sticky bit

Examples

  • chmod  ug+x file   ;  assign execute permission to user and group in file
  • chmod a+x  <file>  ;  assign execute permission to all in file
  • chmod o-x  <file>  ;  remove execute permission to others in file
  • chmod go+r  <file>  ;  assign read permission to group & others in file
  • chmod u+rwx ,g+rw,o+r  file

Special permissions – sticky bit , setuid , setguid bit

sticky bit

when sticky bit is set the file or script is kept in swap space and loaded in to memory on next request. This makes memory loading faster.

sticky bit is represented by t in symbol mode , for example

$chmod +t file.sh

In octal mode sticky bit is represented by 1

$chmod 1755 file.sh

Set user id – setuid and set group id –  setguid bits

when these bits are set for user or groups , they are given effective permission of owner of the file during run time

for example , if file.txt is owned by root and you need to give just run time root permission to some user , you can set the setuid for file.

Following examples sets the setuid , setguid on file along with normal 755 permission.

$chmod 4755 file.txt

you need to give just run time root permission to some group of users , you can set the setgid for file.

$chmod 4755 file.txt

Share