Skip to content

Latest commit

 

History

History
47 lines (43 loc) · 677 Bytes

create_sudoer_user_in_ubuntu.md

File metadata and controls

47 lines (43 loc) · 677 Bytes

Create sudoer user in Ubuntu

useradd -m -s /usr/bin/bash ${username}
passwd ${username}
New password:
sudo usermod -g sudo ${username}

Install OpenSSH

sudo apt-get install openssh-server

Setup Login Key

ssh-keygen -f myLoginKey.pem -y > myLoginKey.pub
cp myLoginKey.pub /root/.pub
ssh-copy-id ${username}@${hostname}

Set SSH Entrance

chsh -s /bin/bash
usermod -s /bin/bash ${username}

Example

useradd -m -s /usr/bin/bash luphia
passwd luphia <<!
asdf1234
!
sudo usermod -g sudo luphia
sudo apt-get install openssh-server <<!
Y
!