54
votes
How to setup a restricted SFTP server on Ubuntu?
Step 1 : Install OpenSSH package if not installed
sudo apt-get install openssh-server
Step 2 : Create separate group for SFTP users.
sudo addgroup ftpaccess
Step 3 : Edit /etc/ssh/sshd_config ...
- 541
29
votes
Accepted
sftp - how to connect to non-default port?
You can use the -oPort=port_number option
sftp -oPort=port_number host_name
man sftp
sftp - secure file transfer program
sftp [-1Cv] [-B buffer_size] [-b batchfile] [-F ssh_config] [-o
...
- 12.5k
23
votes
Changing permissions for /var/www/html
You can make yourself the owner of that directory
sudo chown pi /var/www/html
But you definitely want to set the permissions
chmod 755 -R /var/www/html
Using the -R (recursive) option will make ...
- 3,079
17
votes
How to connect to SFTP in FileZilla using a private key
You have to configure the key authentication.
Open the menu Edit > Settings… and navigate to Connection > SFTP.
Add the key files and you're done.
- 87.7k
17
votes
Accepted
Changing permissions for /var/www/html
In this case I would leave the directory ownership alone. To modify the permissions for that specific directory so that you can write to it, set read/write permissions, the command being sudo chmod ...
- 861
16
votes
sshfs giving "remote host has disconnected"
Old question, but the first one that comes up for this problem.
My issue was the server required key authentication, but I was running the command using sudo and specifying -o IdentityFile=~/.ssh/...
- 261
15
votes
Accepted
Filezilla or WinSCP alternative for Ubuntu
Using Nautilus
You can use the option Connect to Server in Nautilus as it is shown on the next image.
If you need to find the command-line path to the mounted directory use one of the approaches ...
- 28.8k
14
votes
filezilla error Pageant failed to answer challenge
This happened to me. What I did to fix it was:
echo $SSH_AUTH_SOCK
to find out what the path is. This will return something like /home/user/.cache/keyring-XXXXXX/ssh or /run/user/1000/keyring/ssh. ...
- 815
12
votes
How to set up a SFTP server with users chrooted in their home directories?
Just wanted to add that folder permissions up the directory tree need to be set a certain way.
sshd's strict ownership/permissions requirements dictate that every
directory in the chroot path ...
- 241
12
votes
Accepted
Limit SFTP user access to specified directory
Settings for /etc/ssh/sshd_config
Subsystem sftp internal-sftp -f AUTH -l VERBOSE
UsePAM yes
Match group sftp
ChrootDirectory %h
ForceCommand internal-sftp
AllowTcpForwarding no
create group ...
- 10.2k
11
votes
How to create a SFTP (SSH) User with extremely limited permissions
Let's start
Create user ubuntu
sudo useradd ubuntu
Make password
sudo passwd ubuntu
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Create for SFTP ...
- 10.2k
11
votes
Accepted
Ubuntu 14.04 Nautilus "connect to server..." window changed
Finally solved it!
I don't know why but Nautilus 3.10 treats in an odd way the ~/.ssh/config file, or at least this is what I've experienced.
This is how my ~/.ssh/config file looks like:
Host ...
- 181
10
votes
Accepted
Attempt of apt-get install sftp fails with : E: Package 'sftp' has no installation candidate
I believe the package you want to install is openssh-server.
sudo apt-get install openssh-server
Source: How to setup a restricted SFTP server on Ubuntu?
- 14.5k
8
votes
How can I chroot sftp-only SSH users into their homes?
I spent the whole day trying to get a network share on my raspberry.
I wanted to lock the user so that it would not be able to navigate through the whole file system, no ssh login access and I wanted ...
- 91
8
votes
sftp - how to connect to non-default port?
You can use -P option or -oPort option to SFTP to a server from a specific port.
sftp -oPort=port_no username@x.x.x.x
eg. sftp -oPort=8022 rahul@x.x.x.x
or
sftp -P port_no username@x.x.x.x
eg. ...
- 327
7
votes
How to enable SFTP Support in cURL?
If you can't find --without-libssh2 to replace with --with-libssh2 you can search for --without-ssl and append --with-libssh2, tested with curl Version 7.35.0 on Ubuntu 14.04.2
Customized answer from ...
- 181
7
votes
Accepted
sshfs giving "remote host has disconnected"
Your Subsystem value in sshd_config is wrong.
It should be Subsystem sftp /usr/lib/openssh/sftp-server or internal-sftp. Try to modify the /etc/ssh/sshd_config to this value, restart the ssh service ...
- 6,435
7
votes
Changing permissions for /var/www/html
You need to set the www folder owner from 'root' to 'Me'.
From your terminal, run the command :
sudo chown -R your_system_username /var/www
Hope it Works!!
- 323
7
votes
Accepted
How to build the latest curl from sources to allow downloading files via sftp?
Note: Installing software from a third-party source is a safety risk. Make sure you trust the sources before following these steps.
First, you'll need libssh installed.
You'll need a tarball, e.g.
...
- 5,914
6
votes
Accepted
Connection closed when trying to connect to sftp server. Match group issue?
Exit status 127 is command not found.
Your sshd_config shows: Subsystem sftp internal- sftp
The line is supposed to be Subsystem sftp internal-sftp (no space between internal and sftp) or else your ...
6
votes
sshfs giving "remote host has disconnected"
You'll get this error if the remote server is running Dropbear rather than OpenSSH.
SSHFS uses SFTP, and Dropbear doesn't provide SFTP. So when you try
to use it, the Dropbear server sees a ...
- 91
6
votes
Using a VPS service, can I prevent my data from being accessible by the VPS host?
Unfortunately it is not possible at all. Here you are few short explanations about this:
Even with encryption, the provider could snapshot the current state of memory and disk and clone a new ...
- 28.8k
6
votes
Accepted
Nautilus - Connect to Server option not visible
You should:
Enable leftside bar with F9 (skip this step if it is already enabled).
Click on Other locations
Find Connect to Server in the buttom of the window:
Enter address with protocol - one from ...
- 94.4k
5
votes
Too many authentication failures for root in filezilla
BEWARE: FileZilla tries to connect using the keys in .ssh directory.
I had same trouble. After doing some analysis of FileZilla logs (debug logs can be enabled by setting the debug level = 3 in Edit >...
- 261
5
votes
Accepted
How to associate a keyfile with a site in FileZilla
Sorry, the previously mentioned is not true. I was too naive that things can work out together.
In FileZilla you have to add the key using, menu Edit → Preferences → SFTP, as you did. Or ...
- 6,435
5
votes
Accepted
Using "put" command in sftp gives "no such file or directory"
My guess is that you're not in the correct local path, to find out where is your current directory at your local machine, use: lpwd.
If you where in a wrong path then use lcd to move into correct ...
- 53k
5
votes
Changing permissions for /var/www/html
While the above answers will pretty much do the trick, this is a more wholesome approach. Chances are you want to modify files inside /var/www/html because you want to add a web app to serve in ...
- 341
5
votes
16.04: Filezilla crashes when performing any remote action
I had set up the "deb http://archive.getdeb.net/ubuntu xenial-getdeb apps" repo. Then I installed Filezilla. On 03/27/2018 that gave me Filezilla 3.21. I was using sFTP. It crashed every second ...
- 1,285
5
votes
Accepted
How do I cd the remote server directory mounted through File/Nautilus?
Nautilus (and other file managers) have their mounts in /run
Try to search unter /run/user/<UID>/gvfs/<mount>/.
If you regularly need CLI commands, I'd suggest mounting from CLI, too.
- 2,258
4
votes
Granting a sftp user access to a /var/www directory
I've a simple method and that worked for me for apache.
sudo useradd -d /var/www demo_user -g www-data
sudo passwd demo_user
sudo service ssh restart
That's it in case you still face permission ...
- 197
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
sftp × 404ssh × 194
server × 104
permissions × 78
ftp × 47
nautilus × 39
chroot × 30
networking × 25
14.04 × 24
16.04 × 19
openssh × 19
filezilla × 18
command-line × 17
mount × 14
apache2 × 13
vsftpd × 12
scp × 11
20.04 × 10
bash × 9
dolphin × 9
18.04 × 8
samba × 8
cron × 7
sshfs × 6
12.04 × 5