Linux and Ubuntu command

Linux and Ubuntu command

Basic command-:

Uname -: for product name

Uname –I -: for version

Uname –r -: recursive details

 

How to configure IP in Ubuntu



How to change existing configured IP

Bring NIC interface UP and down

nmcli con up id 'Wireless connection 1'


How to install SSH on Ubuntu-;

sudo apt update

sudo apt install openssh-server




SSH service is running type the following command

sudosystemctl status ssh

If after installation still failing to start ssh service please run this command

sudo apt-get purge openssh-server
sudo apt-get install openssh-server
 

 

 

The default setting in Debian (and hence Ubuntu) for OpenSSH Server is to deny password-based login for root and allow only key-based login. Change this line in /etc/ssh/sshd_config:

PermitRootLogin without-password

to

PermitRootLogin yes

And restart the SSH server:

sudo service ssh restart
 

How to change hostname in Ubuntu-:

Open Terminal and use below command

hostnamectl    to check current hostname

to rename hostname use below command

sudo hostnamectl set-hostname linuxize


 

Change Name and press CTRL +O and enter to save

Ctrl+X to exit.

Now change entry in host file as well for that run below command

How to install python in Ubuntu

If you are installing in on fresh installed Ubuntu and you don’t have installed essential package, you will get below error for that first run below command.

Download Python


Extract this file into home directory

Open terminal go to that path i.e


Run below command

Once configuration done run below command to install python

After installation run below command to check default phython version running

Above python has been installed on 7th Oct that is old version

Run below command to check latest version. Go into installation directory and check which version has installed

Now run below command to set default

How to install JAVA JDK

First check which version is latest one and run below command> change only software Name

How to install Apache in Ubuntu

Installation will start once installation will done.

Open browser and type local host or computer IP or 127.0.0.1 and press enter if the page is opening it means it’s working

You can run this command to start and stop apache service


How to check partition size in Ubuntu

Df–h

Here /dev/sda1 define total size and used size

How to create new partition

Now press t for Type-:



 

How to Save Changes in Vim

Vim Save and Quit Command

To save a file and exit Vim:

1. Switch to command mode by pressing the ESC key.

2. Press (colon) to open the prompt bar in the bottom left corner of the window.

3. Type after the colon and hit Enter. This will save the changes and exit.

Vim Save And Quit The Editor Command

Alternatively, a command that will also save a file and exit the text editor is:

:wq

In which case the stands for write (=save) and stands for quit.

 

Exit Without Saving Changes in Vi / Vim

To exit Vim without saving changes:

1. Switch to command mode by pressing the ESC key.

2. Press (colon) to open the prompt bar in the bottom left corner of the window.

3. Type q! after the colon and hit Enter to exit without saving the changes.

 

How to Save a File in Vi / Vim Without Exiting

To save a file without exiting in Vim:

1. Switch to command mode by pressing the ESC key.

2. Type (colon). This will open the prompt bar in the bottom left corner of the window.

example of saving a file without exiting in Vim

3. Type after the colon and hit Enter. This will save in Vim the changes made to the file, without exiting.

You can also rename an existing file by adding the new name after the commands.

:w [newfilename]

In the picture below, we renamed the existing example1.txt into newexample.

example of renaming a file using vi/vim text editor

 

 

 

 

 

·       Cursor movementh, j, k, l (left, down, up, and right)

·       Delete characterx

·       Delete linedd

·       Mode toggleEscInsert (or i)

·       Quit:q

·       Quit without saving:q!

·       Run a shell command:sh (use 'exit' to return)

·       Save file:w

·       Text search

 

 

  



Script to get VMName, Installed vmtools version, ToolsStatus, ToolsRunningStatus, PowerState, details and export to .csv or send over mail

 

 

PowerShell script to generate VMTool status report

Open Windows PowerShell ISE and run below command to save user ID and password in encrypted file.

$credential = Get-Credential

$credential.Password | ConvertFrom-SecureString | Set-Content c:\temp\password2.txt





now you will see one .txt file has created at below path

c:\temp\password2.txt

Run below command to check vCenter connectivity

Connect-VIServer -server vc6.ads.com -Credential $credential


Run below command to generate report and export at some location

$report = Get-VM | Get-View | Select-Object @{N=”VM Name”;E={$_.Name}},@{Name=”VMware Tools”;E={$_.Guest.ToolsStatus}} | Export-CSV c:\temp\VMwareToolsStatus.csv



Now you will see one file has created at given path



Save below PSCommand in .ps1 file and run it to get VMTool report

$credential = Get-Credential

$credential.Password | ConvertFrom-SecureString | Set-Content c:\temp\password1.txt

Connect-VIServer -server vc6.ads.com -Credential $credential

#$credential =Get-VICredentialStoreItem -File "C:\temp\password1.txt"

#$credential = Get-VICredentialStoreItem -file C:\temp\password1.xml

$report = Get-VM | Get-View | Select-Object @{N=”VM Name”;E={$_.Name}},@{Name=”VMware Tools”;E={$_.Guest.ToolsStatus}} | Export-CSV c:\temp\VMwareToolsStatus3.csv


Script to get VMName, Installed vmtools version, ToolsStatus, ToolsRunningStatus, PowerState, details and export to .csv or send over mail 

$credential = Get-Credential
$credential.Password | ConvertFrom-SecureString | Set-Content c:\temp\password1.txt
Connect-VIServer -server vc6.ads.com -Credential $credential
Get-VM | Select @{N=”VMName”; E={$_.Name}},@{N=”HardwareVersion”; E={$_.Extensiondata.Config.Version}},@{N=”ToolsVersion”; E={$_.Extensiondata.Config.Tools.ToolsVersion}},@{N=”ToolsStatus”; E={$_.Extensiondata.Summary.Guest.ToolsStatus}},@{N=”ToolsVersionStatus”; E={$_.Extensiondata.Summary.Guest.ToolsVersionStatus}},@{N=”ToolsRunningStatus”; E={$_.Extensiondata.Summary.Guest.ToolsRunningStatus}},PowerState | Export-CSV c:\temp\VMwareToolsStatus33.csv -NoTypeInformation -UseCulture

Send-MailMessage –From VMTool@domain.com –To raju.prasad01@domain.com –Subject “Guess what!” -Attachment "VMwareToolsStatus3.csv" –Body “I am Testing to get VMTool service status from PowerShell” -SmtpServer mail.ads.corp -UseSsl -Port 25

Error: Invalid server certificate when connecting with vCenter through PowerShell

  

Error: Invalid server certificate

 

PS C:\Users\Administrator> connect-viserver -server 192.168.1.50

connect-viserver : 6/30/2021 8:01:49 AM Connect-VIServer                Error: Invalid server certificate. Use

Set-PowerCLIConfiguration to set the value for the InvalidCertificateAction option to Prompt if you'd like to connect

once or to add a permanent exception for this server.

Additional Information: Could not establish trust relationship for the SSL/TLS secure channel with authority

'192.168.1.50'.

At line:1 char:1

+ connect-viserver -server 192.168.1.50

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : SecurityError: (:) [Connect-VIServer], ViSecurityNegotiationException

    + FullyQualifiedErrorId : Client20_ConnectivityServiceImpl_Reconnect_CertificateError,VMware.VimAutomation.ViCore.

   Cmdlets.Commands.ConnectVIServer



Run below command to by pass invalid Certificate

PS C:\Users\Administrator> Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$true

 

Perform operation?

Performing operation 'Update PowerCLI configuration.'?

[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

 

Scope    ProxyPolicy     DefaultVIServerMode InvalidCertificateAction  DisplayDeprecationWarnings WebOperationTimeout

                                                                                                  Seconds

-----    -----------     ------------------- ------------------------  -------------------------- -------------------

Session  UseSystemProxy  Multiple            Ignore                    True                       300

User                     Multiple            Ignore

AllUsers

 

Again run command to connect with vCenter

PS C:\Users\Administrator> connect-viserver -server 192.168.1.50

 

Name                           Port  User

----                           ----  ----

192.168.1.50                   443   VSPHERE.LOCAL\Administrator




Create CIFS and NFS enabled volume in NetApp

 

Open browser enter cluster management IP

Enter user ID -:  Admin

Enter password-: ******

 

First step to add license for enable services if license won’t be there you can’t start services

After login to console click on configuration

licenses > Add

 




Add licenses one by one from license file


Expend applications tier -> Click add Aggregate



Click on manually create Aggregate

Give Name

and select number of Disks

Now new Aggregation disk group has created.

 

Expend storage -> SVMs -> type SVM Name and check mark on services

Select security type

Select Aggregate level

 

Click submit and continue

In assign IP address tab -> select without a subnet

Assign IP address

 

In assign IP address tab -> select without a subnet

Assign IP address

Give Server Name

Share Name

Active Directory 

Assign Size

Assign Physical interface to travel the traffic


SVM Name:CIFS

IPspace:

Default

Volume Type:

FlexVol volumes

Default Language:

C.UTF-8

Security Style:

NTFS

Root Aggregate:

NFS_Aggregatge

Search Domains:

ads.com

Name Servers:

192.168.1.12

Protocols Enabled:

CIFS, NFS, iSCSI

Bottom of Form

Top of Form

CIFS/NFS Configuration

CIFS and NFS Data LIF:

Success

Subnet:

-NA-

IP Address:

192.168.1.52

Netmask:

255.255.255.0

Route Details:

Route created

Gateway:

192.168.1.1

Destination:

0.0.0.0/0

Home Node:

NetApp_Clue-01

Home Port:

e0a

CIFS Server Creation:

Failed

ONTAP API Failed: Failed to create the Active Directory machine account "CIFS". Reason: SecD Error: no server available Details: Error: Machine account creation procedure failed [ 512] Loaded the preliminary configuration. [ 649] Created a machine account in the domain [ 670] Successfully connected to ip 192.168.1.12, port 445 using TCP [ 676] Encountered NT error (NT_STATUS_MORE_PROCESSING_REQUIRED) for SMB command SessionSetup [ 677] Cluster and Domain Controller times differ by more than the configured clock skew (KRB5KRB_AP_ERR_SKEW) [ 677] Kerberos authentication failed with result: 7537. [ 679] Encountered NT error (NT_STATUS_MORE_PROCESSING_REQUIRED) for SMB command SessionSetup [ 679] Cluster and Domain Controller times differ by more than the configured clock skew (KRB5KRB_AP_ERR_SKEW) [ 679] Kerberos authentication failed with result: 7537. [ 681] Unable to connect to LSA service on srv12.ads.com (Error: RESULT_ERROR_KERBEROS_SKEW) [ 681] No servers available for MS_LSA, vserver: 2, domain: ads.com. **[ 681] FAILURE: Unable to make a connection (LSA:ADS.COM), ** result: 6940 [ 683] Could not find Windows SID 'S-1-5-21-876682103-3312334367-2603367056-512' [ 691] Deleted existing account 'CN=CIFS,CN=Computers,DC=ads,DC=com' .

 

 

NFS Service:

Started

NIS Domain Creation:

Skipped

 

Bottom of Form

Top of Form

iSCSI Configuration

iSCSI protocol is not configured for this SVM.

Bottom of Form

Top of Form

SVM Administration

Administrator Password Modified

 

Subnet:

-NA-

IP Address:

192.168.1.54

Netmask:

255.255.255.0

Home Node:

NetApp_Clue-01

Home Port:

e0b

Route Details:

Route already exists

Gateway:

192.168.1.1

Destination:

0.0.0.0/0

Bottom of Form

If you want to manage permissions for SVM peering, navigate to

Manage Peering Permissions

page.

 

 

 

 

 

 

 

 

 

 

 

Featured Post

HPE MSA 2040 configuration step by step

HPE MSA 2040 configuration Default IP range for HP SAN storage MSA 2040 is 10.0.0.1/2 You need to connect your laptop and storage with...