Useful console commands

Some linux commands that I’ll probably need in the future User management Add user to a group sudo usermod -aG group user or sudo adduser <user> <group> Delete user userdel user Delete the user’s home directory and mail spool: userdel -r user Remove user from a group sudo gpasswd -d user group list all users: $ getent passwd list all groups: $ getent group list all groups of the current user:...

June 9, 2017 · SergeM

Mount windows shares in linux

Use sudo if needed Mount mkdir /mnt/share mount -t cifs //windows_machine_ip/share_name -o username=user,password=urPassword /mnt/share To allow write access one has to specify owning user and group: sudo mount -t cifs //windows_machine_ip/share_name -o uid=$(id -u),gid=$(id -g),user=,password= /mnt/share Unmount umount /mnt/shares

June 19, 2016 · SergeM