$ free -m
$ uname -a
$ cat /proc/cpuinfo | grep 'name' | uniq
$ fdisk -l | grep 'Disk /dev/'
- User name
- Encrypted password (
x
means that the password is stored in the/etc/shadow
file) - User ID number (UID)
- User’s group ID number (GID)
- Full name of the user (GECOS)
- User home directory
- Login shell (defaults to
/bin/bash
)
$ cat /etc/passwd
$ awk -F: '{ print $1, $2, $3, $4, $5, $6}' /etc/passwd
or
$ cat /etc/passwd | grep -i 'root' | awk -F: '{ print $1, }'
or
$ awk -F: '{ for (x=1; x<=6; x++) printf("%s ", $x);printf("\n") }' /etc/passwd
or
$ cat /etc/passwd | grep -i 'root' | awk -F: '{ for (x=1; x<=6; x++) printf("%s ", $x);printf("\n") }'
User the adduser
command to add a new user.
$ adduser {USERNAME}
Use the usermod
command to add the user to the sudo
group.
I cannot get sudoer permission through using this way. Please consider using below way to add user to
sudo
group.
$ usermod -aG sudo {USERNAME}
or
Change /etc/sudoers
file to add the user to the sudo
group.
-
Use
su
to switch to root user -
Open
/etc/sudoers
file. If you still don't have access permission after switching to root, usechmod u+w /etc/sudoers
command to add read / write permission. -
Edit
/etc/sudoers
file, add{USERNAME} ALL=(ALL) ALL
under theroot ALL=(ALL) ALL
, save and quit. -
Undo
/etc/sudoers
file if needed. Runchmod u-w /etc/sudoers
-
Create a existed or emply folder on Window10
-
Set Read/Write permission to everyone
-
Use
sudo apt install cifs-utils
to install cifs on Unbuntu -
Create a share folder on Ubuntu
$ sudo mkdir /mnt/shared
- Mount Windows shared folder onto Ubuntu
$ mount -t cifs -o username="yuk4",password="{Password}",domain="CORP",sec=ntlm,iocharset=utf8 //10.35.83.84/Users/yuk4/work/linux /mnt/shared
If you want to have a specified settings for folder access right, you can try to append
dir_mode=777 file_mode=777
to the end of the command.
- Mount Windows shared folder to the specified
uid/gid
onto Ubuntu
Get uid and gid
$ cat /etc/passwd | grep 'yuk4'
yuk4:x:1001:1001:,,,:/home/yuk4:/bin/bash
yuk4's uid is 1001, gid is 1001
Umount existing mountpoint
$ Umount /mnt/shared
Mount
$ mount -t cifs -o username="yuk4",password="{Password}",domain="CORP",sec=ntlm,iocharset=utf8,uid="1001",gid="1001" //10.35.83.84/Users/yuk4/work/linux /mnt/shared