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

Поділитися
Вставка
  • Опубліковано 30 кві 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?

КОМЕНТАРІ • 106

  • @harryprer
    @harryprer 5 днів тому +1

    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 4 роки тому +4

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

  • @karamjeetdalal3024
    @karamjeetdalal3024 3 роки тому +3

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

    • @ServerGyan
      @ServerGyan  3 роки тому

      Thank you dear for your words
      Happy learning

  • @MurangShaBu_MahalNaBiGas
    @MurangShaBu_MahalNaBiGas Рік тому

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

  • @sriramketha7662
    @sriramketha7662 2 роки тому +1

    Thank you for detail explanation.

  • @leelakrishnan2020
    @leelakrishnan2020 4 роки тому +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  4 роки тому +1

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

  • @yashthaker6726
    @yashthaker6726 4 роки тому +1

    Always Informative. Thankyou sir

  • @Ather178
    @Ather178 3 роки тому

    Beautiful. Thank you for sharing this! Much Appreciated!

    • @emmittkyrie2965
      @emmittkyrie2965 2 роки тому

      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 2 роки тому

      @Emmitt Kyrie Instablaster =)

    • @emmittkyrie2965
      @emmittkyrie2965 2 роки тому

      @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 2 роки тому

      @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 2 роки тому

      @Emmitt Kyrie glad I could help :)

  • @saumiyasomanathan5840
    @saumiyasomanathan5840 7 місяців тому +1

    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.

    • @ServerGyan
      @ServerGyan  7 місяців тому

      Glad you enjoyed it!

  • @saimurthy3680
    @saimurthy3680 2 роки тому +1

    Good explanation👍

  • @harispalegar6806
    @harispalegar6806 2 роки тому +1

    Thanks for the sharing

  • @grvkmr1
    @grvkmr1 4 роки тому +1

    fascinated session

  • @Mhmdd786
    @Mhmdd786 4 роки тому +1

    Thankyou sir...

  • @naveenkadari1698
    @naveenkadari1698 2 роки тому +1

    It was nice and please add more realtime scenario in linux

    • @ServerGyan
      @ServerGyan  2 роки тому

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

  • @sharma2029
    @sharma2029 4 роки тому +1

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

  • @SilentSolution
    @SilentSolution 2 роки тому

    Thanks for your information sir

  • @abhinawsingh1
    @abhinawsingh1 Рік тому

    Thanks

  • @SandeepSingh-hn6it
    @SandeepSingh-hn6it 2 роки тому +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 2 роки тому

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

    • @ServerGyan
      @ServerGyan  2 роки тому +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 2 роки тому +1

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

  • @prabhakarant542
    @prabhakarant542 4 роки тому +2

    Waiting

  • @sriramketha7662
    @sriramketha7662 2 роки тому +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  2 роки тому

      Sure, you can set ACL for those users on files

  • @santanushan
    @santanushan 4 роки тому +1

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

    • @ServerGyan
      @ServerGyan  4 роки тому

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

  • @simplestuffsbyash4721
    @simplestuffsbyash4721 3 роки тому

    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.

    • @gauravmaurya2030
      @gauravmaurya2030 2 роки тому

      Set SUID bit on the user mode to accomplish the task.

    • @nandhinisakrapani3364
      @nandhinisakrapani3364 Рік тому

      Use SUID , place value 4 before in the unmask value

    • @ashishgupta3788
      @ashishgupta3788 Рік тому

      2. Sticky bit -----> chmod o+t filename or chmod 1777 filename.

  • @saumiyasomanathan5840
    @saumiyasomanathan5840 7 місяців тому

    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.

  • @siyaramkumar9912
    @siyaramkumar9912 4 роки тому +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.😢😢

    • @ServerGyan
      @ServerGyan  3 роки тому +1

      Okay I will share answers

  • @ramireddypoli8873
    @ramireddypoli8873 2 роки тому +1

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

    • @ServerGyan
      @ServerGyan  2 роки тому

      Multiple services will stop working

  • @abhinavpaul5960
    @abhinavpaul5960 4 роки тому +4

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

    • @moizshaikh4480
      @moizshaikh4480 Рік тому

      Run Que length is formula of calculate load average

    • @moizshaikh4480
      @moizshaikh4480 Рік тому

      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 4 роки тому +1

    Can you explain how to calculate load average? Plz

    • @moizshaikh4480
      @moizshaikh4480 Рік тому

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

    • @moizshaikh4480
      @moizshaikh4480 Рік тому

      Hope u have got ur answer

  • @rahulmahure3
    @rahulmahure3 4 роки тому +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 4 роки тому +1

      Have faced same questions..

    • @prashantjaiswal1
      @prashantjaiswal1 4 роки тому +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 4 роки тому +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  4 роки тому

      Thank you dear, I missed it somehow

  • @chaitanyakumar8213
    @chaitanyakumar8213 3 роки тому +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  3 роки тому

      Please use find command for the same
      And use size parameter

    • @chaitanyakumar8213
      @chaitanyakumar8213 3 роки тому

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

    • @ankitapalekar3566
      @ankitapalekar3566 Рік тому +1

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

  • @kiranmahi143
    @kiranmahi143 2 роки тому

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

  • @basavarajn995
    @basavarajn995 2 роки тому

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

  • @nitinrawat9477
    @nitinrawat9477 4 роки тому +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  4 роки тому +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 4 роки тому

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

    • @prashantjaiswal1
      @prashantjaiswal1 4 роки тому +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 3 роки тому

      @@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 3 роки тому +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....

  • @shubhampansare-tm1bf
    @shubhampansare-tm1bf Рік тому +1

    i got 3 questios from this vid. in interview

  • @sanjupdsah
    @sanjupdsah 3 роки тому +1

    ssh -add ??

  • @Mawkisht1
    @Mawkisht1 4 роки тому +1

    gyanfull !

    • @ServerGyan
      @ServerGyan  4 роки тому

      Okay dear, thank you, happy learning

  • @visheshsingh3235
    @visheshsingh3235 3 роки тому +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  3 роки тому +1

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

    • @visheshsingh3235
      @visheshsingh3235 3 роки тому +1

      @@ServerGyan thank you sir

    • @visheshsingh3235
      @visheshsingh3235 3 роки тому +1

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

    • @ServerGyan
      @ServerGyan  3 роки тому +1

      Thank you dear and congratulations
      Happy learning

  • @amrutpatane7487
    @amrutpatane7487 4 роки тому +1

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

  • @DesisettyRameshRam
    @DesisettyRameshRam 2 роки тому +1

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

    • @ServerGyan
      @ServerGyan  2 роки тому

      Can you please explain your question a little more

    • @DesisettyRameshRam
      @DesisettyRameshRam 2 роки тому +1

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

    • @ServerGyan
      @ServerGyan  2 роки тому +1

      There is no shortcut method for configuring it

  • @hamedhamed-ox9ty
    @hamedhamed-ox9ty 3 роки тому +1

    iam unable to find httpd.service file

  • @ManjuHS9841
    @ManjuHS9841 3 роки тому

    How to contact you ?

    • @ServerGyan
      @ServerGyan  3 роки тому

      You can connect us at 8882470500

  • @moinsyed195
    @moinsyed195 3 роки тому +1

    please make real time video

  • @yashsinha5669
    @yashsinha5669 3 роки тому

    Thanks very much for such informative videos sir...