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 LFCS, Linux | Tagged

Ubuntu Advanced Packaging Tool commands

1. 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 apache2 apt-get dist-upgrade (More … 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: https://websphereissues.wordpress.com/2014/11/25/add-ssh-keys-for-a-user-in-linux/ 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

Assign a static IP in Ubuntu

Add the followings into /etc/network/interfaces auto ens33 iface ens33 inet static address 192.168.254.201 netmask 255.255.255.0 gateway 192.168.254.2 dns-nameservers 192.168.254.2 8.8.8.8 Reboot host; OR run the following to avoid reboot: ip addr flush ens33 systemctl restart networking

Posted in Linux, ubuntu | Tagged