Skip to content

Commit 5bfa244

Browse files
Update user_creation_and_ssh_key_configuration
1 parent 1bbe8ab commit 5bfa244

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

user_creation_and_ssh_key_configuration

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Adding_Users () {
88
sudo useradd $1
99
sudo mkdir /home/$1/.ssh
1010
sudo chown $1:$1 /home/$1/.ssh ; sudo chmod 700 /home/$1/.ssh
11-
sudo cd /home/$1/.ssh && sudo ssh-keygen -t rsa -N "" -f /home/$1/.ssh/id_rsa 2>/dev/null
11+
sudo ssh-keygen -t rsa -N "" -f /home/$1/.ssh/id_rsa 2>/dev/null
1212
sudo chown $1:$1 /home/$1/.ssh/id_rsa ; sudo chown $1:$1 /home/$1/.ssh/id_rsa.pub
1313
sudo touch /home/$1/.ssh/authorized_keys ; sudo cp /home/$1/.ssh/id_rsa.pub /home/$1/.ssh/authorized_keys ; sudo chmod 600 /home/$1/.ssh/authorized_keys
1414
sudo chown $1:$1 /home/$1/.ssh/authorized_keys

0 commit comments

Comments
 (0)