Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

change username and home directory linux

1) Log out from current session and log as root user.
2) If you cannot log as root user add another account temporary and log in with it.
3) Run "sudo usermod -l <newuser> <olduser>" from that account.
4) Make sure new account can run sudo. Run this to add new user with sudo privileges. "sudo adduser <username> sudo". This need in case of you cannot log as root.

If you need to change home directory too run this "sudo usermod -d /home/newHomeDir -m newUsername"
Comment

change user of a directory in linux

chown vivek:vivek demo.txt
ls -l demo.txt

#output
-rw-r--r-- 1 vivek vivek 0 Aug 31 05:48 demo.txt
Comment

change user:dir to linux dir/file

sudo chown -R user:group /home/user/dir/
Comment

PREVIOUS NEXT
Code Example
Shell :: if output is null bash 
Shell :: Merge Remote Repository With Local Repository in git command 
Shell :: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), 
Shell :: change folder permissions to public linux 
Shell :: git delete commit 4785cd1e041 
Shell :: github update personal access token 
Shell :: randomstring npm 
Shell :: Checking dependencies BASH 
Shell :: xrandr configure crtc 2 failed ubuntu 
Shell :: how to append two file sin bash 
Shell :: grep capture group 
Shell :: git checkout next commit 
Shell :: download bash 
Shell :: blame in github 
Shell :: remove all local changes git 
Shell :: tail remove newline 
Shell :: how to reinstall alsa 
Shell :: compiling c 
Shell :: get current path unix 
Shell :: you are running create-react-app 
Shell :: dbeaver see real password 
Shell :: vite js install 
Shell :: default .gitignore file 
Shell :: howto register dll windows 10 
Shell :: install blender on Debian Linux 
Shell :: unable to install all modules vmware ubuntu 20.04 
Shell :: kubernetes copy secret form another namespace 
Shell :: pulling a branch from github 
Shell :: speedtest linux 
Shell :: bash do while one line 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =