Monthly Archives: April 2017

File permission and ownership commands

Basics: u=user (owner), g=group, o=others (world), a=all r=read(4); w=write(2); x=execute(1) 1=x, 2=w, 4=r, 5=rx; 6=rw; 7=rwx  P.S. For a directory, read and execute (a+rx) permissions need to be granted to a user to list it’s files and cd into it. chmod: chmod 755 file      … Continue reading

Posted in LFCE, LFCS, Linux

User and group commands in Linux

User commands: useradd  (-d: directory; -s: shell; -G: group list; -c: comments)   useradd -m user    (-m: create user home directory) useradd myuser -d /home/myuser -s /bin/csh -G grp1,grp2 -c “My User” userdel -r user             (Remove user and … Continue reading

Posted in LFCE, LFCS, Linux | Tagged

Ubuntu basic commands

i) Advanced Packaging Tool (apt): apt-get: apt-get update (updates only the list of available packages and their versions, but will not perform any update) apt-get upgrade (this will actually updates already installed packages, must run update before upgrade) apt-get upgrade … Continue reading

Posted in Linux, Other | Tagged

Package management commands

yum: Check and update all the packages: yum check-update yum list updates yum update      (Update but preserve obsolete packages, safer option) yum upgrade    (Update plus forcefully remove obsolete packages) yum: Install or update, list and get details … Continue reading

Posted in LFCE, LFCS, Linux | Tagged ,

Script to check connectivity between single or multiple hosts – telnet

Alternate to telnet commands to check single host: echo > /dev/tcp/{host}/{port} && echo “SUCCESS” || echo “FAILED” timeout 1 bash -c ‘(If output 0 then Sucess else Failed) Script to check connectivity between multiple hosts: #!/bin/bash SRC_HOSTS=(‘src1’ ‘src2’ ‘src3’ ‘src3’ … Continue reading

Posted in Linux | Tagged

No supported authentication methods available (Server sent: publickey)

First of all make sure you have setup ssh keys correctly by following the post: In /var/log/secure, if you noticed the error “Authentication refused bad ownership or modes for directory“, then you need to set “StrictModes no” in /etc/ssh/sshd_config file and … Continue reading

Posted in Other