Difference between revisions of "Installing and configuring rssh to allow only scp and sftp"

From Notes_Wiki
m
m
Line 1: Line 1:
<yambe:breadcrumb>Rssh configuration</yambe:breadcrumb>
<yambe:breadcrumb self="Installing and configuring rssh to allow only scp and sftp">Rssh configuration|Rssh configuration</yambe:breadcrumb>
=Installing and configuring rssh to allow only scp and sftp=
=Installing and configuring rssh to allow only scp and sftp=


Line 20: Line 20:
sshfs <user>@<server:[<path>] <mount_point>
sshfs <user>@<server:[<path>] <mount_point>
</pre>
</pre>
<yambe:breadcrumb self="Installing and configuring rssh to allow only scp and sftp">Rssh configuration|Rssh configuration</yambe:breadcrumb>

Revision as of 07:27, 22 January 2019

<yambe:breadcrumb self="Installing and configuring rssh to allow only scp and sftp">Rssh configuration|Rssh configuration</yambe:breadcrumb>

Installing and configuring rssh to allow only scp and sftp

We can use yum on CentOS to install rssh. After installing edit file '/etc/rssh.conf' and uncomment below lines

allowscp
allowsftp

After this use commmand 'usermod -s /usr/bin/rssh <username>' to set default shell for user as rssh. This would force user to use only sftp and scp commands. SSH shell access for user would get completely disabled. 'gftp', 'winscp' and 'ssh secure file transfer client' have been tested with this setup and they all work fine.

After this even using command 'su - <username&gtt;' for restricted users will stop working.


Mounting sftp filesystems

One can always use fuse-sshfs to mount filesystems/folders restricted by rssh on local machine so that user dont have to worry about synchronizing files between server and local machine. One can install 'fuse-sshfs' package on CentOS and then use below command syntax to mount sshfs filesystems

sshfs <user>@<server:[<path>] <mount_point>


<yambe:breadcrumb self="Installing and configuring rssh to allow only scp and sftp">Rssh configuration|Rssh configuration</yambe:breadcrumb>