Top 10 Scenario-Based Linux Interview Questions and Answers with Practical - Real Time

Sdílet
Vložit
  • čas přidán 30. 04. 2020
  • In this video, I am going to explain some important scenario-based interview questions and answers with practical...
    Scenario-Based Linux Interview Question for Experienced...
    Q-1: A user is not able to ssh to a remote server, what could be the possible cause?
    Q-2: User root has created a file /tmp/abc with 700 permission, you want that your lokendra should have full access to file, how will do this?
    Q-3: How will you change the default login shell for all upcoming users on Linux?
    Q-4: After creating password less ssh access, whenever I try to login to a server it asks me for the password, While I have verified that my public key is placed on a remote server?
    Q-5: How to disable the root account?
    Q-6: I have a server where httpd service is running, I want that httpd should be running on cpu core no 2 only.
    Q-7: After reboot, I can see a time difference in /var/log/message and os time.
    Q-8: I want to restart a service only if the service is already running. If service is in a stopped state, the command should do nothing.
    Systemctl try-restart httpd.service
    Q-9: What is max filename length allowed in Linux? 255
    Q-10: What is drop cache in Linux and how do you clear it?
    Please watch the following video for another interview question
    • Linux Interview Questi...
    In this video, I am going to explain some real-time interview questions and answers for 2-4 years of experience.
    Linux Interview Questions and Answers
    Q- How will you change the default user id value in Linux?
    Q- root# rm -rf /tmp/test gives error operation not permitted. Reason?
    Q- /etc/hosts (Which RPM is responsible for creating this file).
    Q- What is the difference between RPM and YUM?
    Q- What is the difference between Hard and Soft Link?
    Q- What is a sticky bit?
    Q- How will you check open ports on Linux Server?
    Q- How will you check open ports on remote servers (without login)
    Q- Your site is throwing 500 error, how will you start troubleshooting?
    Q- How will you start troubleshooting if your site is down?
    Q- How will you create space on disk if it is showing 100% used?
    Q- What is a package of sar command and what does it do?

Komentáře • 106

  • @harryprer
    @harryprer Před 23 dny +2

    An user not being able to ssh into a server, first I check whether it is an isolated case. If it is, the most likely cause in a prod environment is either he has forgotten his password or he has not bothered to change his password before expiry or he probably doesn't have account on the server itself. If the login is key-based, then I go into permission of the private key, or check if user's public key is present in remote server etc. But that is super rare. :D

  • @yashkumar0042
    @yashkumar0042 Před 4 lety +4

    i was searching this type of videos from long time. Finally got it Server Gyan ! Thanks

  • @sriramketha7662
    @sriramketha7662 Před 2 lety +1

    Thank you for detail explanation.

  • @yashthaker6726
    @yashthaker6726 Před 4 lety +1

    Always Informative. Thankyou sir

  • @MurangShaBu_MahalNaBiGas

    You earn a sub brother, I love Linux your videos helps me a lot.

  • @karamjeetdalal3024
    @karamjeetdalal3024 Před 3 lety +4

    Thanks for your outstanding contribution in terms of sharing knowledge for the welfare of society.

    • @ServerGyan
      @ServerGyan  Před 3 lety

      Thank you dear for your words
      Happy learning

  • @leelakrishnan2020
    @leelakrishnan2020 Před 4 lety +6

    Hi Lokendra, Thanks for your outstanding contribution in terms of sharing knowledge to the entire society,I'm requesting you to share some videos related with Magento,Apache & Nginx administration,Nagios & Zabbix network monitoring,solr search,God bless you for all your continuous efforts.

    • @ServerGyan
      @ServerGyan  Před 4 lety +1

      Thank you dear, I will surely try for topic as per your suggestions

  • @Ather178
    @Ather178 Před 3 lety

    Beautiful. Thank you for sharing this! Much Appreciated!

    • @emmittkyrie2965
      @emmittkyrie2965 Před 2 lety

      you prolly dont give a damn but does someone know a method to get back into an Instagram account?
      I somehow lost the login password. I love any assistance you can offer me

    • @westleytitan4640
      @westleytitan4640 Před 2 lety

      @Emmitt Kyrie Instablaster =)

    • @emmittkyrie2965
      @emmittkyrie2965 Před 2 lety

      @Westley Titan thanks so much for your reply. I got to the site thru google and im in the hacking process atm.
      I see it takes quite some time so I will get back to you later with my results.

    • @emmittkyrie2965
      @emmittkyrie2965 Před 2 lety

      @Westley Titan It worked and I now got access to my account again. I'm so happy!
      Thanks so much you saved my account :D

    • @westleytitan4640
      @westleytitan4640 Před 2 lety

      @Emmitt Kyrie glad I could help :)

  • @saumiyasomanathan5840
    @saumiyasomanathan5840 Před 8 měsíci +2

    This was so interesting. Its very boring to always watch something in a traditional way of basics to advance. This was nice with miced up all level of questions and with scenario based .❤plus, this is so deep.So many new things fr me.

  • @saimurthy3680
    @saimurthy3680 Před 2 lety +1

    Good explanation👍

  • @grvkmr1
    @grvkmr1 Před 4 lety +1

    fascinated session

  • @Mhmdd786
    @Mhmdd786 Před 4 lety +1

    Thankyou sir...

  • @harispalegar6806
    @harispalegar6806 Před 2 lety +1

    Thanks for the sharing

  • @abhinawsingh1
    @abhinawsingh1 Před rokem

    Thanks

  • @naveenkadari1698
    @naveenkadari1698 Před 2 lety +1

    It was nice and please add more realtime scenario in linux

    • @ServerGyan
      @ServerGyan  Před 2 lety

      Sure dear,
      I will keep on adding new videos
      Thanks for suggestion
      Happy learning

  • @SilentSolution
    @SilentSolution Před 2 lety

    Thanks for your information sir

  • @sharma2029
    @sharma2029 Před 4 lety +1

    Thank you 😇... Like this make video of aws

  • @prabhakarant542
    @prabhakarant542 Před 4 lety +2

    Waiting

  • @SandeepSingh-hn6it
    @SandeepSingh-hn6it Před 2 lety +1

    Beautiful. Thank you for sharing this! Much Appreciated!
    I have some query could you help us. 1. what is the command of clear the disk space in Linux/CentOs
    2.if CPU goes above of set threshold, what could be the reason and what should be the troubleshoot action ?
    3.How to check Disk read and write bytes what is the command ?

    • @SandeepSingh-hn6it
      @SandeepSingh-hn6it Před 2 lety

      Sir Dil to mere hai.. app ne Comment ka Jabab nahi diya gol kar diya..hahaa Can you please

    • @ServerGyan
      @ServerGyan  Před 2 lety +1

      Hi
      You need to analyse data which can be deleted on server, then you can remove unwanted data.
      Use du -sh command do analyse
      You top command to check cpu usage
      SAR, or iostat, iotop or dstat command to check disk io

    • @SandeepSingh-hn6it
      @SandeepSingh-hn6it Před 2 lety +1

      @@ServerGyan Great Sir. Thanks, please make shell scripting for this is very imp for who will be try to Cloud as my undersetting.

  • @santanushan
    @santanushan Před 4 lety +1

    Hi Sir, can you please make a video regarding converting a boot volume into LVM type

    • @ServerGyan
      @ServerGyan  Před 4 lety

      Dear Santanu,
      If it's created on aws, by default it's lvm backed up.

  • @saumiyasomanathan5840
    @saumiyasomanathan5840 Před 7 měsíci

    Isn't that listening port and ipv4 ipv6 are in comment form .. are they still active with that hash ( comment) ? A genuine doubt , sir since I am a student. My question is about first question sshd file.

  • @sriramketha7662
    @sriramketha7662 Před 2 lety +1

    I have a doubt, i shared a file and in a group vfx, suppose 50 users added, i want only 4 members specially in a group can have access to delete or edit that file?

    • @ServerGyan
      @ServerGyan  Před 2 lety

      Sure, you can set ACL for those users on files

  • @simplestuffsbyash4721
    @simplestuffsbyash4721 Před 3 lety

    Hi ServerGyan,
    Could you please tell me the answer for the below question:
    1. Write one "find" command sequence that search a file name "debug.log" under /var/log/debug and replace string "WARN" to "ERROR"
    2. I want to create a directory such that anyone in the group can create a file and access any person's file in it but none should be able to delete a file other than the one created by himself.

  • @abhinavpaul5960
    @abhinavpaul5960 Před 4 lety +4

    can you please explain in short how load average is calculated in linux ?

    • @moizshaikh4480
      @moizshaikh4480 Před rokem

      Run Que length is formula of calculate load average

    • @moizshaikh4480
      @moizshaikh4480 Před rokem

      Load average is Cumilative and Combined load of system. If u run command load average then u will get 3 diffrent load averages.1st one is Load average of last 1 min, 2nd is Load average of last 5 mins and 3rd one is load average of last 15 mins load of your system. I hope this was helpful.

  • @akgollapalli209
    @akgollapalli209 Před 4 lety +1

    Can you explain how to calculate load average? Plz

    • @moizshaikh4480
      @moizshaikh4480 Před rokem

      Run que lengh is formula of Calculate load average. In short Load average= Running Processes + Runable processes

    • @moizshaikh4480
      @moizshaikh4480 Před rokem

      Hope u have got ur answer

  • @siyaramkumar9912
    @siyaramkumar9912 Před 4 lety +1

    1. How can i check which process running on particular cpu.
    2.in LVM my disk is corrupt how to find which disk is corrupt and hiw to recover that data. How to replace it .
    3. What to do when try to up my system but its doesn't work, tell how to troubleshoot without my system running. Pls reply sir. If you have some real time interview questions than pls share with me. Because due to pandemic i lost my job so i really need these thing.😢😢

  • @kiranmahi143
    @kiranmahi143 Před 2 lety

    4years experience azuredevops scenario Based interview Question and Answer tell me bro 🙏🏻plz

  • @sanjupdsah
    @sanjupdsah Před 3 lety +1

    ssh -add ??

  • @ramireddypoli8873
    @ramireddypoli8873 Před 2 lety +1

    Accidently run chmod -R / abc:abc what will happen, what will the impact in o.s

    • @ServerGyan
      @ServerGyan  Před 2 lety

      Multiple services will stop working

  • @Mawkisht1
    @Mawkisht1 Před 4 lety +1

    gyanfull !

    • @ServerGyan
      @ServerGyan  Před 4 lety

      Okay dear, thank you, happy learning

  • @rahulmahure3
    @rahulmahure3 Před 4 lety +3

    Hello Sir,
    I have few questions which was asked me recently
    1. What details you give to Storage Team to Extend the Disk
    2. What command you used to see which LUN is Assign with Which Disk
    3. If 10GB is added by Storage team but you are not able to get that 10GB then how we troubleshoot it

    • @rejibs
      @rejibs Před 4 lety +1

      Have faced same questions..

    • @prashantjaiswal1
      @prashantjaiswal1 Před 4 lety +6

      @Rahul: 1: we need to provide the WWN number to the storage team and they can assign a new LUN/storage based on the WWN number.
      2:you have to first scan the newly assigned luns using the echo command
      echo "- - -" > /sys/class/scsi_host/host*/scan. then you can use multipath -ll command or you can use ls -la /dev/disk/by-id/. it will show the luns assigned.
      3: as earlier said, you have to scan the disk and it will show newly added disks.
      Hope this answers your question

    • @rahulmahure3
      @rahulmahure3 Před 4 lety +1

      @@prashantjaiswal1 Thank You Prashant
      We can also scan the newly assigned luns by using sg3 package but
      Need to install sg3 package
      on server and then just run the below Command:-
      # rescan-scsi-bus.sh

      OR
      # /usr/bin/rescan-scsi-bus.sh

    • @ServerGyan
      @ServerGyan  Před 4 lety

      Thank you dear, I missed it somehow

  • @basavarajn995
    @basavarajn995 Před 2 lety

    I am not able to login server I am getting sudo file error

  • @chaitanyakumar8213
    @chaitanyakumar8213 Před 3 lety +1

    Bro I have a question, I have 100MB files in my Linux server but I don't know in which directories are present. So I have to find all 100MB files in all directories and remove them. How we can solve this question?

    • @ServerGyan
      @ServerGyan  Před 3 lety

      Please use find command for the same
      And use size parameter

    • @chaitanyakumar8213
      @chaitanyakumar8213 Před 3 lety

      @@ServerGyan can you provide the command for the same?

    • @ankitapalekar3566
      @ankitapalekar3566 Před rokem +1

      @@chaitanyakumar8213
      Find / -type f -size 100M -exec rm -rf {}\;

  • @shubhampansare-tm1bf
    @shubhampansare-tm1bf Před rokem +1

    i got 3 questios from this vid. in interview

  • @amrutpatane7487
    @amrutpatane7487 Před 4 lety +1

    Hi Sir,
    Please bmake font bigger. Not able to see properly

  • @DesisettyRameshRam
    @DesisettyRameshRam Před 2 lety +1

    Hi brother
    How to allocate multiple particians
    Like 10 particians
    Can you explain one time please

    • @ServerGyan
      @ServerGyan  Před 2 lety

      Can you please explain your question a little more

    • @DesisettyRameshRam
      @DesisettyRameshRam Před 2 lety +1

      Multiful pathing how to create. Is there any short cut method is there

    • @ServerGyan
      @ServerGyan  Před 2 lety +1

      There is no shortcut method for configuring it

  • @nitinrawat9477
    @nitinrawat9477 Před 4 lety +4

    I have been asking u this same question for 3 months.. what's the difference between permissions given by chmod and suid ....but despite saying you would include it in ur coming videos...u never answered it or included it in any of ur videos.........
    also tell me what will happen if we don't include #!/bin/bash in our script.....will it run or not...or will generate error....
    also difference between authorized_keys and known_hosts files

    • @ServerGyan
      @ServerGyan  Před 4 lety +10

      Dear Nitin,
      Sorry for the same,
      Let's start with chmod and suid
      chmod command is used to assign permission to a file or directory. It can assign permission to user, group or others only. but if you need to assign/revoke permission for a single user then you need to use setfacl command.
      SUID is used to assign special permission on any executable file, such as PING command. if you run ping command as non root user, it gets executed as root because of suid. if you remove suid, you won't be able to run ping command.
      In short, if you want a file to be executed as of its owner is executing it, we need to use SUID.
      Now let's talk about #!/bin/bash
      If you add this in script then you don't need to specify script file name ending with file.sh, your script will run without .sh ececution. but if you don't write #!/bin/bash then you need to mention.
      I hope this answers your question.

    • @nitinrawat9477
      @nitinrawat9477 Před 4 lety

      @@ServerGyan u left the 3rd question....

    • @prashantjaiswal1
      @prashantjaiswal1 Před 4 lety +2

      @@@nitinrawat9477: when we try to connect any client through ssh, it sends its private key to client-server and it gets copied to the destination server and later it is used to authenticate that client knows the server. If your private key gets changed, your connection will get failed. This private key file resides in client known_hosts file and it used to identify the server identity through saved private key. known_hosts resides on the client."authorized_keys" resides on the server

    • @maimoonamirza5626
      @maimoonamirza5626 Před 3 lety

      @@nitinrawat9477 are you paying him tuition fees. Have some courtesy and respect. U are asking him questions as if he owes something to u

    • @nitinrawat9477
      @nitinrawat9477 Před 3 lety +2

      @@maimoonamirza5626 dear friend it's not about money it's about courtesy and loyalty to his loyal subscribe.... Please first go and check how many times I have asked him those questions.... He also promised me to answer them in his next video but he didn't.... I waited to 2 months but when he didn't, I have just commented to make him remind of his promise.... If his subscriber can't even ask questions to him what's the point then..... I have not used bad or improper word for him..... Please have some common sense before judging someone....

  • @visheshsingh3235
    @visheshsingh3235 Před 3 lety +1

    hi sir ! how we know that particular service is using some specific CPU . is there any command or we have to check CPUAffinity ?

    • @ServerGyan
      @ServerGyan  Před 3 lety +1

      ps -o psr 27395. You can check with following command

    • @visheshsingh3235
      @visheshsingh3235 Před 3 lety +1

      @@ServerGyan thank you sir

    • @visheshsingh3235
      @visheshsingh3235 Před 3 lety +1

      @@ServerGyan your videos are very good . i had crack my Ericsson interview with the help of your tutorials
      Thank you

    • @ServerGyan
      @ServerGyan  Před 3 lety +1

      Thank you dear and congratulations
      Happy learning

  • @hamedhamed-ox9ty
    @hamedhamed-ox9ty Před 3 lety +1

    iam unable to find httpd.service file

  • @ManjuHS9841
    @ManjuHS9841 Před 3 lety

    How to contact you ?

  • @moinsyed195
    @moinsyed195 Před 3 lety +1

    please make real time video

  • @yashsinha5669
    @yashsinha5669 Před 3 lety

    Thanks very much for such informative videos sir...