Selasa, 27 Februari 2018

How To Piece Of Occupation Sudo Ascendance Without Entering Password Inwards The Linux

Sudo ascendence without Password: - We cause got to perform twenty-four hours to twenty-four hours activities inwards our information technology infrastructure, Sometime nosotros postulate to run simply about ascendence inwards whatever application or within simply about script that may require sudo alongside the command. 

Therefore, inwards this guide, I am going to explicate how to configure password less sudo. As per our requirement nosotros tin setup sudo for all the ascendence or nosotros tin exclusively specify simply about ascendence to run equally sudo without password.

Prerequisites- 

  • One user alongside sudo access (amar)
  • One normal user (sudotest)

Step 1- setup sudo access for all the commands.

  • Login to Linux Machine user alongside sudo access.
  • modify /etc/sudoers file together with grant permission to sudotest user.
  • Open sudoers file

amar@U16: $ sudo vi /etc/sudoers 
  • Add next line 
sudotest ALL=(ALL) NOPASSWD:ALL


  • Save together with larn out From the file.
Step 2- Verify sudo access without password for user sudotest

  • Login to linux machine using sudotest user.
  • To verify sudotest user's sudo access without entering password, let's endeavor to halt Apache2 service using ascendence below

 sudo /etc/init.d/apache2 stop



  • Apache2 Service has been stopped successfully using sudo without entering password.
Please Note:- If you lot are working alongside an organization, where you lot cause got to assign permission to multiple user, inwards such instance you lot tin practice a grouping together with allow grouping to execute sudo ascendence without entering password, afterward add together all those user inwards this group.

Step 3- Allow a user to run specify command  only.

  • Some scheme administrator may required to grant permission to simply about user to execute few commands  alongside sudo equally per the projection requirement.  In such instance nosotros tin grant sudo access to exclusively specific commands.
  • Let's cause got an example- H5N1 user postulate to reload apache2 service to apply modified changes but User is non fellow member of Sudo group.
Try to reload apache2 service without granting access:

sudo /etc/init.d/apache2 reload
here is output of the command:

  • Grant user raj permission to reload apache2 service.
  • Open /etc/sudoers file - I am editing this file alongside user amar (have sudo access)

amar@U16: $ sudo vi /etc/sudoers
Append follow line-
raj             ALL=(ALL) NOPASSWD:/bin/systemctl
Save together with larn out from the file.
Save together with larn out from the file.

  • Let's verify past times reloading apache2 service.

sudo /etc/init.d/apache2 reload

Systemctl ascendence working successfully without entering password.

Sumber https://linuxhowtoguide.blogspot.com/

Kamis, 22 Februari 2018

How To Setup Jenkins Projection In Addition To Specify Windows Node To Execute Builds.

Jenkins Job:
In the Jenkins Master in addition to Slave surroundings nosotros tin direct the specific node to execute build.
in around cases nosotros may required windows platform to run build. 

In my previous blog- I accept explained how to setup Windows Node equally Slave, Let's setup basic chore to execute on Windows platform.


Prerequisites-

  • Jenkins Windows node. 
  • In my representative i am using Linux equally Master in addition to Windows equally Slave. As inward moving-picture demonstrate below.

Step 1- Setup Job in addition to assign Windows node to execute build.

  • Login to Jenkins equally Admin > New Item > Enter Item name(Win_Powershell) > Type Freestyle >OK

  • On the side yesteryear side concealment select Restrict where this projection tin last run
  • In the Label Expression> Windows Node name.

  • In the Build steps > add > execute Windows batch ascendancy > in box type ascendancy to execute 
  • %SystemRoot%\system32\windowspowershell\v1.0\powershell.exe get-date > C:\Jenkinstest.txt
  • Apply and Save.

Step 2- Run the laid upward in addition to banking concern lucifer output at Windows Node.
  • After setting upward Project, let's run kickoff Build.
  • Select Build Now

  • Check laid upward logs
  • Build history > direct Build Number > Console Output










  • After success amount laid upward y'all Job output volition last similar this.

Basic Jenkins Job configured successfully amongst Windows Slave node. You tin customized chore script equally per your requirement.



Sumber https://linuxhowtoguide.blogspot.com/

Rabu, 21 Februari 2018

How To Setup Jenkins Slave On Windows Alongside Principal On Linux Macine

Jenkins: Windows every bit Slave Node-  

Jenkins Master comes amongst the basic installation in addition to you lot tin configure projection every bit per your requirement. Jenkins Master handles all the configuration in addition to task for your build.


Now, sometime you lot demand to stimulate got Slave Windows Jenkins to run projection that actually demand Windows environment to execute to a greater extent than or less script, ascendancy etc.

In Jenkins Master in addition to Slave surround you lot tin configure multiple projection amongst unlike OS environment. Jenkins Master operate JNLP (JAVA Network Launch Protocol) agent to communicate amongst Slave node.

Jenkins Master is to schedule all the hit task in addition to assign Slave node for specific Project. It is easier to stimulate got online in addition to offline slave node every bit per requirement. To avoid manual commencement of JNLP nosotros tin install it every bit a service in addition to Slave node tin easily come upward online afterward a reboot.

Let's commencement setting upward Jenkins Slave on Windows spell Master on Linux.

Prerequisites-
  • Jenkins Master on Linux  (IP-192.168.102.12)
  • Windows Machine - IP 10.0.1.107 (JAVA Must last installed)
Step 1- Install Windows Slaves Plugins-
  • Login to Jenkins Master > Manage Jenkins > Manage Plugins


  • At Plugins page pick out Available > inward the filter search - type Windows Slaves > Install without restart

Step 2- Enable the TCP port of JNLP agent

  • Login to Jenkins every bit admin
  • Manage Jenkins > Configure Global Security  
  • On the adjacent enshroud select TCP port for JNLP agents > Random > Apply > Save




Step 3- Add Windows node to Master Jenkins.
  • Login to Jenkins Master > Manage Jenkins > Manage Nodes


  • On adjacent enshroud click on new node > Node Name (i.e. Windows-Agent)


  • On the Next Scree fill the node details

  • At adjacent Screen click on Launch



  • It volition download the file Slave-Agent.jnlp
  • Copy slave-agent.jnlp to the Windows machine.
Step 4-  Install slave-agent.jnlp at Windows Machine.
  • Before starting agent installation at Windows brand sure, Windows machine stimulate got JAVA installed, If non delight download in addition to install Java.
  • Download in addition to install Java from the next link.
    http://javadl.oracle.com/webapps/download/AutoDL?BundleId=230542_2f38c3b165be4555a1fa6e98c45e0808

  • Once Java installation finished. Go to Java path: C:\Program Files\Java\jre1.8.0_161\bin
  • Right click on JAVA.exe executable file in addition to send shortcut to desktop
  • Now correct click on Java shortcut available at desktop in addition to modify target.

  • Now Right click on Java shortcut at desktop in addition to Launch it.

  • At adjacent Screen click Run












  • On the Next Page you lot encounter that your agent is instantly connected with Jenkins Master.
  • Let's install the Jenkins slaves every bit a service in addition to thus that whenever your Windows machine larn restarted. Slave Agent come upward online automatic.

  • To Install Jenkins Slave service - File > Install every bit a service > OK
  • Jenkins Slave service installation volition last consummate in addition to you lot volition see jenkinsslave-C__Jenkins in Services console.
  • Go to Run > Services.msc
  • Let's banking corporation fit Node condition inward the Master Jenkins





  • Login to Jenkins Master > Manage Jenkins > Manage Nodes



  • Jenkins Windows Slave Node installation procedure completed.

    Troubleshooting: 
    You may sense to a greater extent than or less issues during service installation process.

    • If you lot ran into the same upshot spell installing jenkins slave service delight follow the steps.
    • Open ascendancy prompt every bit Administrator.




    • Change the directory (cd C:\Users\asingh\Desktop) to desktop Java shortcut.
    • Run the shortcut - It volition destination the installation. 
    • After jenkins Slave service successful installation, you lot volition encounter the slaves service inward services console.

    • Let's banking corporation fit Node condition inward the Master Jenkins
    • Login to Jenkins Master > Manage Jenkins > Manage Nodes


    Jenkins Slave Windows Node communication established. Now nosotros hit to setup Build amongst Windows Node.



    Part 2-  How to Setup Jenkins Project in addition to specify Windows Node to execute builds.







    Sumber https://linuxhowtoguide.blogspot.com/

    Minggu, 04 Februari 2018

    How To Delete Bash Ascendancy History Inwards Linux

    Bash History:- Bash history keeps the history of commands executed past times user inwards the final session. This allow us to re-use previous commands using up arrow key or nosotros tin run history command to cheque whole listing of commands.

    Generally, it's non required to delete whatever dominance from the history simply approximately fourth dimension nosotros bespeak to delete few commands.
    Example-  By mistake, In a dominance i cause got entered password inwards plainly text format in addition to I don't desire permit the history tape this password. In this instance i volition delete that dominance from the history.

    Let's cause got a await at dominance below.

    During MySQL connecter command, i mentioned password inwards command. equally inwards pic below.
    root@PVM-Linux-UDev: # history 

    Now, I desire to delete this dominance from the history list.

    Let's role below dominance to delete the specific dominance from the history.

    To delete unmarried dominance role next command.

    root@PVM-Linux-UDev: # history -d 2008


    In the higher upward dominance role dominance ID amongst history -d dominance .
    Let's confirm deleted entry using history command.
    root@PVM-Linux-UDev: # history 

    To clear entire dominance listing role next command.

    root@PVM-Linux-UDev: # history -c



    Using history -c command,  yous tin clear entire bash history. See inwards higher upward illustration cypher is there.
    Alternatively yous tin run below dominance to clear entire bash history.
    root@PVM-Linux-UDev: # cat /dev/null >  /.bash_history 

    Please note:- Generally, Normal user tin stance his ain bash history in addition to tin perform whatever activity over them. But root user in addition to stance anyone's bash history.



    Sumber https://linuxhowtoguide.blogspot.com/