#obtool
ob> lsuser --long username
ob> chuser --class oracle lashdown
ob> mkuser username --class admin --password "sia#2018" --givenname "username" --unixname root --unixgroup "root" --preauth OSB:username+rman+cmdline --ndmpuser no
Thursday, 13 June 2019
Wednesday, 29 May 2019
Displaying Fibre Channel Devices
Displaying Fibre Channel Devices
The commonly used commands for adding, removing, and displaying FC devices are as follows:fcinfo – Collects and displays administrative information about FC-HBA ports on hosts, remote ports, and configured logical units. For more information, see the fcinfo(1M) man page. The following examples show the most common administration operations that can be performed by using the fcinfo command:
Example 1 Display Information of the HBA Ports and Their Link Statistics To list information of the HBA ports and their link statistics use the fcinfo hba-port -l command.
# fcinfo hba-port -l
HBA Port WWN: 2100000e1ec95100
Port Mode: Initiator
Port ID: 150300
OS Device Name: /dev/cfg/c6
Manufacturer: QLogic Corp.
Model: 7023303
Firmware Version: 8.05.00
FCode/BIOS Version: BIOS: 3.19; fcode: 4.02; EFI: 5.36;
Serial Number: 463916R+1606293054
Driver Name: qlc
Driver Version: 161214-5.06a
Type: N-port
State: online
Supported Speeds: 4Gb 8Gb 16Gb
Current Speed: 8Gb
Node WWN: 2000000e1ec95100
Link Error Statistics:
Link Failure Count: 0
Loss of Sync Count: 0
Loss of Signal Count: 0
Primitive Seq Protocol Error Count: 0
Invalid Tx Word Count: 0
Invalid CRC Count: 0
Max NPIV Ports: 253
NPIV port list:
HBA Port WWN: 2100000e1ec95101
Port Mode: Initiator
Port ID: 20801
OS Device Name: /dev/cfg/c7
Manufacturer: QLogic Corp.
Model: 7023303
Firmware Version: 8.05.00
FCode/BIOS Version: BIOS: 3.19; fcode: 4.02; EFI: 5.36;
Serial Number: 463916R+1606293054
Driver Name: qlc
Driver Version: 161214-5.06a
Type: NL-port
State: online
Supported Speeds: 4Gb 8Gb 16Gb
Current Speed: 8Gb
Node WWN: 2000000e1ec95101
Link Error Statistics:
Link Failure Count: 0
Loss of Sync Count: 0
Loss of Signal Count: 0
Primitive Seq Protocol Error Count: 0
Invalid Tx Word Count: 37825
Invalid CRC Count: 0
Max NPIV Ports: 253
NPIV port list:
Example 2 Display All The Remote Ports on All the HBAs
To list all the remote ports on all the HBAs, use the fcinfo remote-port command.# fcinfo remote-port
HBA Port WWN: 2100000e1ec95100
Count of Remote Port(s): 4
Remote Port WWN: 10000000c97ecedc
Active FC4 Types: SCSI,IP
SCSI Target: no
Port ID: 150400
Port Symbolic Name:
Node WWN: 20000000c97ecedc
Remote Port WWN: 21000024ff41d9a4
Active FC4 Types: SCSI
SCSI Target: no
Port ID: 150200
Port Symbolic Name: qlc(0,0)
Node WWN: 20000024ff41d9a4
Remote Port WWN: 201600a0b82a38bc
Active FC4 Types: SCSI
SCSI Target: yes
Port ID: 150700
Port Symbolic Name: SUN CSM200_R 0660
Node WWN: 200600a0b82a38bc
Remote Port WWN: 21000024ff51bb4a
Active FC4 Types: SCSI
SCSI Target: yes
Port ID: 150100
Port Symbolic Name: qlt0,0
Node WWN: 20000024ff51bb4a
HBA Port WWN: 2100000e1ec95101
Count of Remote Port(s): 11
Remote Port WWN: 10000000c9c07a6d
Active FC4 Types: SCSI,IP
SCSI Target: no
Port ID: 20b00
Port Symbolic Name:
Node WWN: 20000000c9c07a6d
Remote Port WWN: 21000024ff2cd75a
Active FC4 Types: SCSI,IP
SCSI Target: no
Port ID: 20200
Port Symbolic Name:
Node WWN: 20000024ff2cd75a
Remote Port WWN: 202200a0b85a8c82
Active FC4 Types: SCSI
SCSI Target: yes
Port ID: 20400
Port Symbolic Name: SUN LCSM100_F 0735
Node WWN: 200200a0b85a8c82
Remote Port WWN: 21000024ff2cd75b
Active FC4 Types: SCSI,IP
SCSI Target: no
Port ID: 20300
Port Symbolic Name:
Node WWN: 20000024ff2cd75b
Remote Port WWN: 10000000c97ecedd
Active FC4 Types: SCSI,IP
SCSI Target: no
Port ID: 20900
Port Symbolic Name:
Node WWN: 20000000c97ecedd
Remote Port WWN: 202300a0b85a8c82
Active FC4 Types: SCSI
SCSI Target: yes
Port ID: 20600
Port Symbolic Name: SUN LCSM100_F 0735
Node WWN: 200200a0b85a8c82
Remote Port WWN: 203200a0b85a8c82
Active FC4 Types: SCSI
SCSI Target: yes
Port ID: 20700
Port Symbolic Name: SUN LCSM100_F 0735
Node WWN: 200200a0b85a8c82
Remote Port WWN: 2100001b321a45e5
Active FC4 Types: SCSI,IP
SCSI Target: no
Port ID: 20100
Port Symbolic Name:
Node WWN: 2000001b321a45e5
Remote Port WWN: 203300a0b85a8c82
Active FC4 Types: SCSI
SCSI Target: yes
Port ID: 20500
Port Symbolic Name: SUN LCSM100_F 0735
Node WWN: 200200a0b85a8c82
Remote Port WWN: 2101001b323a45e5
Active FC4 Types: SCSI,IP
SCSI Target: no
Port ID: 20000
Port Symbolic Name:
Node WWN: 2001001b323a45e5
Remote Port WWN: 10000000c9c07a6c
Active FC4 Types: SCSI,IP
SCSI Target: no
Port ID: 20a00
Port Symbolic Name:
Node WWN: 20000000c9c07a6c
Example 3 Display All the Remote Ports Visible Through a Local HBA Port and Their Link Statistics
To list all the remote ports visible through a local HBA port and their link statistics, use the fcinfo remote-port -ls -p PWWN command.# fcinfo remote-port -ls -p 2100000e1ec95100
HBA Port WWN: 2100000e1ec95100
Count of Remote Port(s): 4
Remote Port WWN: 10000000c97ecedc
Active FC4 Types: SCSI,IP
SCSI Target: no
Port ID: 150400
Port Symbolic Name:
Node WWN: 20000000c97ecedc
Link Error Statistics:
Link Failure Count: 0
Loss of Sync Count: 6
Loss of Signal Count: 2
Primitive Seq Protocol Error Count: 0
Invalid Tx Word Count: 33
Invalid CRC Count: 0
Remote Port WWN: 21000024ff41d9a4
Active FC4 Types: SCSI
SCSI Target: no
Port ID: 150200
Port Symbolic Name: qlc(0,0)
Node WWN: 20000024ff41d9a4
Link Error Statistics:
Link Failure Count: 0
Loss of Sync Count: 0
Loss of Signal Count: 0
Primitive Seq Protocol Error Count: 0
Invalid Tx Word Count: 4
Invalid CRC Count: 0
Remote Port WWN: 201600a0b82a38bc
Active FC4 Types: SCSI
SCSI Target: yes
Port ID: 150700
Port Symbolic Name: SUN CSM200_R 0660
Node WWN: 200600a0b82a38bc
Link Error Statistics:
Link Failure Count: 12
Loss of Sync Count: 1024
Loss of Signal Count: 20842
Primitive Seq Protocol Error Count: 0
Invalid Tx Word Count: 0
Invalid CRC Count: 0
Remote Port WWN: 21000024ff51bb4a
Active FC4 Types: SCSI
SCSI Target: yes
Port ID: 150100
Port Symbolic Name: qlt0,0
Node WWN: 20000024ff51bb4a
Link Error Statistics:
Link Failure Count: 1
Loss of Sync Count: 0
Loss of Signal Count: 0
Primitive Seq Protocol Error Count: 0
Invalid Tx Word Count: 0
Invalid CRC Count: 0
LUN: 0
Vendor: SUN
Product: COMSTAR
OS Device Name: Unknown
Example 4 Display All the Logical Units and Its Information
To list all the logical units and its information, use the fcinfo lu -v command.OS Device Name: /dev/rmt/3n
HBA Port WWN: 2100000e1ec95101
Controller: /dev/cfg/c7
Remote Port WWN: 500104f000ad3d19
LUN: 0
State: unknown
Class:
Vendor: SUN
Product: EXAMPLE-TD7
Device Type: Tape Device
Unformatted capacity: 0.000 MBytes
OS Device Name: /dev/rmt/5n
HBA Port WWN: 2100000e1ec95101
Controller: /dev/cfg/c7
Remote Port WWN: 500104f000ad3d0e
LUN: 0
State: unknown
Class:
Vendor: SUN
Product: EXAMPLE-TD5
Device Type: Tape Device
Unformatted capacity: 0.000 MBytes
Example 5 Display All the Logical Units on a Remote Port
To list all the logical units on a remote port, use the fcinfo lu -v -P PWWN command.
# fcinfo lu -v -P 500104f000ad3d19
OS Device Name: /dev/rmt/0n
HBA Port WWN: 2100000e1ec95101
Controller: /dev/cfg/c7
Remote Port WWN: 500104f000ad3cfe
LUN: 0
State: unknown
Class:
Vendor: STK.EXAMPLE
Product: T10000A
Device Type: Tape Device
Unformatted capacity: 0.000 MBytes
cfgadm
– Dynamically reconfigures storage devices and FC
devices. This command is used most frequently to configure storage
devices on a SAN. This command also provides configuration
administration operations on dynamically reconfigurable hardware
resources. For more information, see the cfgadm(1M) man page. The following examples shows the different administration operations that can be performed by using the cfgadm command:Example 6 Display All the Attachment Points The cfgadm command lists all attachment points except dynamic attachment points.
# cfgadm Ap_Id Type Receptacle Occupant Condition c1 scsi-sas connected configured unknown c2 scsi-sas connected configured unknown c3 scsi-sas connected configured unknown c4 scsi-sas connected configured unknown c5 scsi-sas connected configured unknown c6 fc-fabric connected unconfigured unknown c7 fc-public connected unconfigured unknown c8 scsi-sas connected configured unknown c9 scsi-sas connected configured unknown hca:10E00001430070 IB-HCA connected configured ok ib IB-Fabric connected configured ok usb0/1 unknown empty unconfigured ok usb0/2 unknown empty unconfigured okExample 7 Display the Current Configurable Hardware Information To list the current configurable hardware information, including those represented by dynamic attachment points, use the cfgadm -al command.
# cfgadm -al Ap_Id Type Receptacle Occupant Condition c1 scsi-sas connected configured unknown c1::dsk/c1t0d0 CD-ROM connected configured unknown c2 scsi-sas connected configured unknown c2::w5000cca0162922a1,0 disk-path connected configured unknown c3 scsi-sas connected configured unknown c3::w5000cca0162b81b5,0 disk-path connected configured unknown c4 scsi-sas connected configured unknown c4::w5000cca0162b899d,0 disk-path connected configured unknown c5 scsi-sas connected configured unknown c5::w5000cca0162a6bcd,0 disk-path connected configured unknown c6 fc-fabric connected unconfigured unknown c6::10000000c97ecedc unknown connected unconfigured unknown c6::201600a0b82a38bc disk connected unconfigured unknown c6::21000024ff41d9a4 unknown connected unconfigured unknown c6::21000024ff51bb4a unknown connected unconfigured unknown c7 fc-public connected unconfigured unknown c7::10000000c97ecedd unknown connected unconfigured unknown c7::10000000c9c07a6c unknown connected unconfigured unknownExample 8 Display the Status of the LUN To know the status of the LUN, use the cfgadm -al -o show_SCSI_LUN command. For example:
# cfgadm -al -o show_SCSI_LUN Ap_Id Type Receptacle Occupant Condition c6 fc-fabric connected configured unknown c6::10000000c97ecedc unknown connected configured unknown c6::201600a0b82a38bc disk connected unconfigured unknown c6::21000024ff41d9a4 unknown connected unconfigured unknown c6::21000024ff51bb4a unknown connected unconfigured unknown c7 fc-public connected unconfigured unknown c7::10000000c97ecedd unknown connected unconfigured unknown c7::10000000c9c07a6c unknown connected configured unknown c7::10000000c9c07a6d unknown connected unconfigured unknown c7::202200a0b85a8c82 disk connected unconfigured unknown c7::202300a0b85a8c82 disk connected unconfigured unknown c7::203200a0b85a8c82 disk connected unconfigured unknown c7::203300a0b85a8c82 disk connected unconfigured unknown c7::2100001b321a45e5 unknown connected unconfigured unknown c7::21000024ff2cd75a unknown connected unconfigured unknown c7::21000024ff2cd75b unknown connected configured unknown c7::2101001b323a45e5 unknown connected unconfigured unknown
Tuesday, 30 April 2019
Configure SFTP server
Create a
group for collaborative users.
[root@fileserver-01
~]# groupadd -g 1501 dev
Create 3 collaborative users with supplementary group of dev and login shell as /sbin/nologin to restrict shell access by the user.
[root@fileserver-01
~]# useradd -u 1001 -G dev –s /sbin/nologin ahmer
[root@fileserver-01
~]# useradd -u 1002 -G dev –s /sbin/nologin mansoor
[root@fileserver-01
~]# useradd -u 1003 -G dev –s /sbin/nologin danish
Set the home directories of these users as /common.
[root@fileserver-01
~]# usermod -d /common ahmer
[root@fileserver-01
~]# usermod -d /common mansoor
[root@fileserver-01
~]# usermod -d /common danish
Set passwords for the users.
[root@fileserver-01
~]# echo 123 | passwd ahmer --stdin
Changing
password for user ahmer.
passwd: all
authentication tokens updated successfully.
[root@fileserver-01
~]# echo 123 | passwd mansoor --stdin
Changing
password for user mansoor.
passwd: all
authentication tokens updated successfully.
[root@fileserver-01
~]# echo 123 | passwd danish --stdin
Changing
password for user danish.
passwd: all
authentication tokens updated successfully.
[root@fileserver-01
~]#
Create a directory for collaboration and adjust permissions on it
according to the requirement.
[root@fileserver-01
~]# mkdir -p /chroot/sftp
[root@fileserver-01
~]# chmod 555 /chroot/sftp
[root@fileserver-01
~]# mkdir /chroot/sftp/common/
[root@fileserver-01
~]# chgrp dev /chroot/sftp/common/
[root@fileserver-01
~]# chmod 2775 /chroot/sftp/common/
Configure sshd service to handle the collaborative users.
[root@fileserver-01
~]# vi /etc/ssh/sshd_config
Search and Comment the following line.
#Subsystem sftp /usr/libexec/openssh/sftp-server
Add following lines at the end of the /etc/ssh/sshd_config.
Subsystem sftp internal-sftp
Match Group dev
X11Forwarding no
AllowTCPForwarding no
ChrootDirectory
/chroot/sftp/
ForceCommand internal-sftp
–u 007
We have set the user mask as 007 to restrict the other users from accessing
our files.
Monday, 1 April 2019
Subscription add in Redhat linux
- SSH / Get console of the shell of the desired Red Hat system you want to subscribe with the subscription
- run subscription-manager register command andsubscription-manager attach --pool=<POOL_ID>, the pool id can be found using subscription-manager list --available, this pool-ID is the unique ID respective to your subscription
- Internet connectivity to the system is required as the system will get authentication of the subscription from access.redhat.com
- verify the subscription is current/invalid from subscription-manager status command, If the output says " Current " means the system is registered with proper subscription, anything other than this will come as an output saying "Invalid "
- The subscription can be attached to any Red Hat system, where the environment is started from RHEL 5.7 to the latest (7.5) one
- If the system had any previously attached subscription, please run these two commands one-by-one subscription-manager clean ; subscription-manager refresh at the system to clear out the previous metadata
- If the system had any previously added repository manually (not through Red Hat subscription) please run these command rm -fr /etc/yum.repos.d/* to delete any Repository configuration file which're not attached through a valid Red Hat subscription.
- You can also see the system attached to the subscription from your purchase account at access.redhat.com where the subscription will be shown attached to which system, the Hostname/ UUID.
-
Resolution
If you continue to see applicable errata displayed in RHSM, it can mean one of a couple of things that need to be addressed:
- The system has not checked in recently, and there is a discrepancy between what you see in the Customer Portal and what is actually installed on your system. In this case, you may want to check which errata are available on your system and force a check in and run yum update again:
# yum update
# rm -f /var/lib/rhsm/packages/packages.json
# service rhsmcertd stop
# rhsmcertd --now
Tuesday, 19 February 2019
How to rescan and recover LUN paths in a host after modifying SLM reporting nodes
Microsoft Windows hosts:
- Rescan after add-reporting-nodes and remove-reporting-nodes using Windows GUI.
- Open Computer Management (Local)
- In the console tree, click Computer Management (Local) >> Storage >> Disk Management
- In the disk management page click Action >> Rescan Disks. This will rescan all the disks and update any path changes.
- Rescan after add-reporting-nodes and remove-reporting-nodes using command line.
- Open Command Prompt and enter the following text:
# diskpart - At the
DISKPART>prompt, enter the following text:DISKPART> rescan.
This will rescan all the disks and updates any path changes. For more information, see Microsoft TechNet Updatedisk. - Linux hosts:
- Rescan after add-reporting-nodes.
- Starting RHEL 6.5 & RHEL 7.0 onwards, run the following command to update active/optimized paths afteradd-reporting-nodes:
# /usr/bin/rescan-scsi-bus.sh –a - For RHEL 5 and RHEL 6.4 (including previous updates), run the following command to update active/optimized paths after add-reporting-nodes:
# /usr/bin/rescan-scsi-bus.sh
Note: Nothing additional has to be done in the multipath layer.
- Starting RHEL 6.5 & RHEL 7.0 onwards, run the following command to update active/optimized paths afteradd-reporting-nodes:
- Rescan after remove-reporting-nodes
- Separate rescan steps are required for SCSI layer and Multipathing layer in Linux storage stack to clean up stale disk paths after remove-reporting-nodes in SLM.
- Run the following command to remove stale LUN paths in SCSI layer
# /usr/bin/rescan-scsi-bus.sh –r - Next run the following command to remove stale LUN paths in multipath layer:
# multipath -rSolaris hosts: - Rescan after add-reporting-nodes
- For iSCSI LUNs, run the following command:
# devfsadm -i iscsi - For FC/FCoE LUNs, perform the following steps:
- Run the following command to identify OS Device name of the HBA ports that are accessing NetApp LUNs:
# cfgadm -al -o show_FCP_dev | grep fc-fabric
c3 fc-fabric connected configured unknown
c4 fc-fabric connected configured unknown - Now run the following command for each <controller> to be rescanned:
# cfgadm -c configure <controller>
For example from Step1 c3 & c4 are the controller names and so the command would be:
# cfgadm -c configure c3
# cfgadm -c configure c4
- Run the following command to identify OS Device name of the HBA ports that are accessing NetApp LUNs:
- For iSCSI LUNs, run the following command:
- Rescan after remove-reporting-nodes
- For iSCSI LUNs, run the following command:
# devfsadm -i iscsi
# devfsadm -Cv - For FC/FCoE LUNs, perform the following steps:
- If the host is accessing NetApp LUNs using a single FC port, then it is advised to reboot the host. Run the following commands to reconfigure and reboot the host.
# touch /reconfigure
# init 6 - But if host is accessing NetApp LUNs with 2 or more FC ports, then run the following commands to identify OS Device names of the HBA ports:
# cfgadm -al -o show_FCP_dev | grep fc-fabric
c3 fc-fabric connected configured unknown
c4 fc-fabric connected configured unknown - Run the following command to reconfigure each port one after the other:
# cfgadm -c unconfigure <controller>
# cfgadm -c configure <controller>
For example from above output c3 & c4 are the controller names and so the commands would be similar to the following:# cfgadm -c unconfigure c3
# cfgadm -c configure c3
# cfgadm -c unconfigure c4
# cfgadm -c configure c4
Note: Above step should be peformed only for one port at a time. - Run the following command to clean up the devices:
# devfsadm -Cv - To clear MPxIO entries, an OS reboot is needed and this can be performed during a planned downtime. Run the following command to reconfigure and reboot the host:
# touch /reconfigure
# init 6 - Once the host is back after reboot, run the following command :
# devfsadm -Cv
- If the host is accessing NetApp LUNs using a single FC port, then it is advised to reboot the host. Run the following commands to reconfigure and reboot the host.
- For iSCSI LUNs, run the following command:
- Open Command Prompt and enter the following text:
Monday, 11 February 2019
HBA Debugging Fiber
mpathadm list LU
$
$
$
fcinfo hba-port -l 2100000e1eca86e1$
fcinfo hba-port -l 2100000e1eca86e0
Sunday, 10 February 2019
SSH Passwordless Login Using SSH Keygen in 5 Easy Steps
SSH Client : 10.11.1.x SSH Remote Host : 10.88.1.x
Step 1: Create Authentication SSH-Kegen Keys on –10.11.1.x
$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/tecmint/.ssh/id_rsa): [Press enter key] Created directory '/home/tecmint/.ssh'. Enter passphrase (empty for no passphrase): [Press enter key] Enter same passphrase again: [Press enter key] Your identification has been saved in /home/tecmint/.ssh/id_rsa. Your public key has been saved in /home/tecmint/.ssh/id_rsa.pub. The key fingerprint is: 5f:ad:40:00:8a:d1:9b:99:b3:b0:f8:08:99:c3:ed:d3 tecmint@tecmint.com The key's randomart image is: +--[ RSA 2048]----+ | ..oooE.++| | o. o.o | | .. . | | o . . o| | S . . + | | . . . o| | . o o ..| | + + | | +. | +-----------------+
Step 2: Create .ssh Directory on – 10.88.1.x
ssh oracle@10.88.1.X mkdir -p .ssh The authenticity of host '10.88.1.X (10.88.1.X)' can't be established. RSA key fingerprint is 45:0e:28:11:d6:81:62:16:04:3f:db:38:02:la:22:4e. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '10.88.1.X' (ECDSA) to the list of known hosts. oracle@10.88.1.X's password: [Enter Your Password Here]
Step 3: Upload Generated Public Keys to –10.88.1.x
$ cat .ssh/id_rsa.pub | ssh oracle@10.88.1.X 'cat >> .ssh/authorized_keys' oracle@10.88.1.X's password: [Enter Your Password Here]
Step 4: Set Permissions on –10.88.1.x
ssh oracle@10.88.1.X "chmod 700 .ssh; chmod 640 .ssh/authorized_keys" oracle@10.88.1.X's password: [Enter Your Password Here]
Step 5: Login from 10.11.1.X to 10.88.1.x Server without Password
ssh oracle@10.88.1.X
Subscribe to:
Posts (Atom)