Administrator

From wiki
Jump to: navigation, search

Contents

Add a user

Command: sudo adduser --disabled-password <lastName_firstInitial>


This command creates a user on the machine with default permissions (755) and a home directory. The default password can be found by accessing the file below (in places of the X's). Upon logging in you will be told that your password has expired and prompted to create a new one. Make sure your password contains both letters, numbers, and at least one capital letter.


Code for: /usr/local/sbin/adduser.local


 #! /bin/bash
 # Make some directories
 mkdir -m 0755 $4/public_html
 chown $1:$1 $4/public_html
 mkdir -m 0700 $4/private
 chown $1:$1 $4/private
 # Make a password and immediately expire it (user must reset at next log in)
 # YOU READING THIS: Replace X with default password
 echo -e "X\nX" | passwd $1
 passwd -e $1
 # add user to samba
 echo -e "X\nX" | smbpasswd -s -a $1

Delete a User

deluser --remove-home --remove-all-files <usernmame>


Code for: /usr/local/sbin/deluser.local


#! /bin/bash
# removes user from samba too
smbpasswd -x $1

Add user to Samba

should not need to do this
the script above should add a user to samba as well
sudo smbpasswd -a <username>

Kick a user off the Server

sudo pkill -KILL <username>

Restore a file from the backup server (must run in kde or gnome)

deja-dup --restore FILENAME

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox