Skip to content
superstringer edited this page Apr 15, 2019 · 1 revision

Linux

Create new user

$ sudo adduser <username>

To add user as a sudoer,

$ sudo adduser <username> sudo

To add a new user say UNAME and create their home directory on /D drive, we do

$ sudo adduser --home /D/home/UNAME UNAME

Delete user

First, if we decide to backup the home folder

$ tar -zcvf homedir_UNAME.tar.gz /home/UNAME

then remove the user together with their home directory

$ sudo deluser --remove-home UNAME

or remove the user and all files on the system owned by the user (including their home directory)

$ sudo deluser --remove-all-files UNAME

Mount the server drive as a folder in Mac

  1. Install osxfuse
  2. Install sshfs
  3. Create a mount point folder. This is where the server's files will appear.
  4. Mount it.
#!bash

$ brew install Caskroom/cask/osxfuse
$ brew install sshfs
$ mkdir -p ~/mount/my-server
$ sshfs -p 22 dh@68.137.6.28: ~/mount/my-server

Install packages locally

$ apt-get source PACKAGE
$ tar xvzf PACKAGE.tar.gz
$ cd PACKAGE
$ ./configure --prefix=$HOME/local
$ make
$ make install

For python, for configure you can do the following instead

$ ./configure --enable-shared --prefix=$HOME/local

You can also then use fakeroot to do stuff.

SSH authentications

To connect to Machine C from Machine B using Machine A's public key without copying over to Machine B, first on Machine A add your SSH (private) key to the ssh-agent, for example on mac you do

$ ssh-add -K ~/.ssh/id_rsa

then connect to Machine B with

$ ssh -A user@MachineB

Then you can ssh to Machine C from that Machine B session.

Clone this wiki locally