Ubuntu: Creating a user with SSH access and write permission to the web-application folder
The following Linux commands helped
sudo chown -R username:username /home/username/.ssh
sudo chmod 0700 /home/username/.ssh
sudo chmod 0600 /home/username/.ssh/authorized_keys
Also, added the following lines into the file /etc/ssh/sshd_config -> did not check whether these are really
required or not. These were placed as part of a different strategy. Should check whether removing these does
change anything or not. Assuming that these are required. Because such commands were not placed for another
user, and that user could not login using ssh.
Port 1234
PermitRootLogin no
AllowUsers testuser
Reference: http://askubuntu.com/questions/16650/create-a-new-ssh-user-on-ubuntu-server Step by Step: Create user:
sudo useradd -d /home/testuser -m testuser
Assign Password:
sudo passwd testuser
You may or may not need to use sudo based on the permission for your userid.
Then use similar commands as below. Please create folder as required
sudo chown -R username:username /home/username/.ssh
sudo chmod 0700 /home/username/.ssh
sudo chmod 0600 /home/username/.ssh/authorized_keys
If still does not work, add these lines in your /etc/ssh/sshd_config file (use: nano /etc/ssh/sshd_config)
Port 1234
PermitRootLogin no
AllowUsers testuser
From: http://sitestree.com/?p=1427
Categories:Root, By Sayed Ahmed
Tags:
Post Data:2014-08-20 19:43:53
Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada