TrinitySEM
asked on
prevent user from deleting .ssh/authorized_keys file
We have setup an Ubuntu server for the purpose of provide SFTP accounts for a number of users. Each user has an account and can upload files to their respective home directories. We are using vsftpd and key pairs. The users do not have SSH access.
The issue I'm having is that I'd like to prevent users from modifying or deleting the authorized_keys file in their /home/user/.ssh directory.
Ideally, we'd prefer that they not see or modify these files and directories, all under the /home/user directory:
.bash_logout
.bashrc
.profile
.ssh
And instead, they would only access the /home/user/files directory.
Any suggestions on how to accomplish this?
Thanks.
The issue I'm having is that I'd like to prevent users from modifying or deleting the authorized_keys file in their /home/user/.ssh directory.
Ideally, we'd prefer that they not see or modify these files and directories, all under the /home/user directory:
.bash_logout
.bashrc
.profile
.ssh
And instead, they would only access the /home/user/files directory.
Any suggestions on how to accomplish this?
Thanks.
rbash
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you. That worked.
One issue is that I created a test file with the root user account and now that user can't delete the file. Any thoughts on how to remove?
Thanks again.
One issue is that I created a test file with the root user account and now that user can't delete the file. Any thoughts on how to remove?
Thanks again.
as root change ownership of this file:
chown username.username /home/username/file
chown username.username /home/username/file