Reference: http://blog.csdn.net/sin90lzc/article/details/7525670
Add new user
sudo adduser username
Reset password when first login
sudo passwd -e username
Delete user
sudo userdel username
Check user details
finger user4
Add user and add into new group
useradd –g users user1
Add user group UID=888
groupadd –g 888 users
Add user1 into group users
gpasswd –a user1 users
Remove user1 from group users
gpasswd –d user1 users
Rename group
groupmod –n usersold usersnew
Delete group
groupdel users
Add to sudoer
Switch to root
visudo
Add one line under root ALL=(ALL) ALL1
newuser ALL=(ALL) ALL1
Save
Check disk status
sudo fdisk -l
Operate on certain disk
sudo fdisk /dev/sdb
New partition
n
Write changes
w
Format partition
sudo mkfs -t ext3 /dev/sdb1
St label for partition
sudo e2label /dev/sdb1 /backup
Set mount location
sudo mkdir /backup
Set auto mount
sudo vim /etc/fstab
add
LABEL=/backup /backup ext3 defaults 1 2
Reboot and check
df -h
Reference: http://blog.csdn.net/zht666/article/details/9340633
Check whether ssh has installed
ps -e|grep ssh
Install ssh-client
sudo apt-get install openssh-client
Install ssh-server
sudo apt-get install openssh-server
start service
sudo /etc/init.d/ssh start
Configure
sudo gedit /etc/ssh/sshd_config
Restart ssh
sudo /etc/init.d/ssh restart
connect using the format of: ssh account@IP
ssh test@192.168.135.249
autostart when boot
systemctl enable ssh.service
Remote Desktop
Reference from: https://jingyan.baidu.com/article/48206aeaab3550216bd6b310.html
sudo apt-get install vnc4server
使用在/usr/share/applications目录下打开“桌面共享”选项,桌面共享选项中必须要开启共享,自己根据需要选择是否需要每次连接提示、密码等
以上步骤完成后,在安装WINDOWS操作系统的电脑中打开VNC Viewer连接Ubantu会提示安全错误 。
Ubantu安装 dconf-editor 软件,输入命令
sudo apt-get install dconf-editor
用Dconf-editor调整,并访问如下配置路径:
org > gnome > desktop > remote-access
取消钩选 “requlre-encryption”属性。
在安装WINDOWS操作系统的电脑中打开VNC Viewer,出现如下提示,恭喜大功告成。
sudo apt-get install xrdp
to avoid authentication prompt for color device
sudo nano /etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla
paste
[Allow Colord all Users] Identity=unix-user:* Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile ResultAny=no ResultInactive=no ResultActive=yes
save and reboot
For other desktop environments
Reference from: http://blog.csdn.net/u011428870/article/details/73611684
Install Mate-desktop
sudo apt-add-repository ppa:ubuntu-mate-dev/xenial-mate sudo apt-get update sudo apt-get upgrade sudo apt-get install mate-desktop-environment mate-notification-daemon
Install xrdp
sudo apt-get install xrdp echo mate-session > ~/.xsession sudo sed -i.bak '/fi/a #xrdp multiple users configuration \n mate-session \n' /etc/xrdp/startwm.sh sudo service xrdp restart
为了使每次连接到同一个session,可以修改xrdp.ini:
sudo gedit /etc/xrdp/xrdp.ini
在[xrdp1]中,修改port=-1为port=ask-1,接着在下一次重新连接时,会发现最下面出现了port一栏,一开始是-1,登陆时记住自己的port,退出再次登陆将port数值改为自己的,就可以继续上次关闭时的状态。
For nfs based file system, following utility is required
sudo apt-get install nfs-common
To mount a Cifs file system, install the following utility
sudo apt install cifs-utils
To mount a path
mount -t cifs //128.208.221.39 /mnt/desktop2 --verbose -o user=li,password=v
mount as user
sudo mount -t cifs //128.208.221.24/OAI-Derived-Data-and-Results /mnt/V --verbose -o user=li,password=,uid=nobody
or edit the files
sudo nano /etc/fstab
add the paths at the end
//128.208.221.39/Ftensorflow /mnt/desktop2/Ftensorflow cifs username=li,password=v,uid=nobody,iocharset=utf8,noperm 0 0
sudo mount -a
setting editor
sudo apt-get install dconf-editor
org –> gnome –> nautilus –> preferences and choose always-use-location-entry
Hide/show dock menu
sudo apt-get install gnome-tweak-tool
alt+f2, r, enter
gnome-tweaks->extension->ubuntu dock
Fix ip
show current connections
nmcli con show
to restore to auto
nmcli con mod "Wired connection 2" ipv4.addresses "" ipv4.gateway "" ipv4.dns "" ipv4.dns-search "" ipv4.method "auto"