Linux Interview Questions

Can ssh keys generated as one user be used as a different user

Ssh keys are generated in pair and are valid as a pair. These are not tied to any user. Sometimes user info goes into the read more

Bash – how to use functions – quick tutorial

Using functions in bash is fairly useful to organise and reuse code. Here is quick beginner tutorial with examples on using bash functions. Declaring functions read more

Bash – how to check if a variable is set

To check if a variable is set or empty, we can use couple of approaches. One approach is to use empty string check (if [ read more

Can global variables be modified in bash function?

Global variables can be accessed in bash function without declaring anything and when these are modified the behaviour depend on whether function is called in read more

How to create ssh public/private keys on command line

Command line utility ssh-keygen can be used to generate rsa or dsa public and private keys. By default it generates rsa keys. Here are commands read more

Edit a file without changing its timestamp on Linux

Usually anytime a file a edited, its timestamp is also changed. There are cases when you want to change the content of a file but read more

How to use ssh port forwarding to surf a site from different location

Sometimes we want to access a web site from a different location or ip to see how various things appear on the site. There can read more

How to connect to mysql server using ssh port forwarding

When mysql server is hosted on a cloud environment like amazon aws/ec2 or rackspace, connecting to it using mysql GUI tools may not be possible without read more