How to change vsftpd's default directory to / instead of the user's home directory?
I currently have vsftpd installed in such a way, that when a user, say for instance my account frederik
authenticates, I will be directed to my home directory /home/frederik/
.
This is a problem for certain FTP clients, as they can not change to anything outside that default folder, for instance /home/
(even given permission).
How can I change it so that authenticated users gets directed to /
instead?
14.04 server ftp vsftpd
add a comment |
I currently have vsftpd installed in such a way, that when a user, say for instance my account frederik
authenticates, I will be directed to my home directory /home/frederik/
.
This is a problem for certain FTP clients, as they can not change to anything outside that default folder, for instance /home/
(even given permission).
How can I change it so that authenticated users gets directed to /
instead?
14.04 server ftp vsftpd
Maybe you won't have to do this. Check this link: vsftpd.beasts.org/vsftpd_conf.html especially your settings ofchroot
for users.
– HATEthePLOT
Mar 2 '16 at 11:11
Related: change home directory only when connecting with FTP
– Eliah Kagan
Jul 30 '17 at 21:29
add a comment |
I currently have vsftpd installed in such a way, that when a user, say for instance my account frederik
authenticates, I will be directed to my home directory /home/frederik/
.
This is a problem for certain FTP clients, as they can not change to anything outside that default folder, for instance /home/
(even given permission).
How can I change it so that authenticated users gets directed to /
instead?
14.04 server ftp vsftpd
I currently have vsftpd installed in such a way, that when a user, say for instance my account frederik
authenticates, I will be directed to my home directory /home/frederik/
.
This is a problem for certain FTP clients, as they can not change to anything outside that default folder, for instance /home/
(even given permission).
How can I change it so that authenticated users gets directed to /
instead?
14.04 server ftp vsftpd
14.04 server ftp vsftpd
asked Mar 2 '16 at 10:59
Fre_d
9114
9114
Maybe you won't have to do this. Check this link: vsftpd.beasts.org/vsftpd_conf.html especially your settings ofchroot
for users.
– HATEthePLOT
Mar 2 '16 at 11:11
Related: change home directory only when connecting with FTP
– Eliah Kagan
Jul 30 '17 at 21:29
add a comment |
Maybe you won't have to do this. Check this link: vsftpd.beasts.org/vsftpd_conf.html especially your settings ofchroot
for users.
– HATEthePLOT
Mar 2 '16 at 11:11
Related: change home directory only when connecting with FTP
– Eliah Kagan
Jul 30 '17 at 21:29
Maybe you won't have to do this. Check this link: vsftpd.beasts.org/vsftpd_conf.html especially your settings of
chroot
for users.– HATEthePLOT
Mar 2 '16 at 11:11
Maybe you won't have to do this. Check this link: vsftpd.beasts.org/vsftpd_conf.html especially your settings of
chroot
for users.– HATEthePLOT
Mar 2 '16 at 11:11
Related: change home directory only when connecting with FTP
– Eliah Kagan
Jul 30 '17 at 21:29
Related: change home directory only when connecting with FTP
– Eliah Kagan
Jul 30 '17 at 21:29
add a comment |
2 Answers
2
active
oldest
votes
You can create a chroot list with vsftpd.conf
Check this
All the users belonging to ftp-users group goes into /home/ftp-docs/ftp_stuff by default when they login. They cannot navigate in other directories and are restricted to this particular directory.
You do this:
Create a directory by issuing the following command as root:
mkdir -p /home/ftp-docs/ftp_stuff
Then do this:-
chgrp ftp-users /home/ftp-docs/ftp_stuff chmod 3777 /home/ftp-docs/ftp_stuff
In the /etc/vsftpd/vsftpd.conf
write this chroot_list_enable=YES chroot_list_file=/etc/vsftpd.chroot_list
Put all you ftp-users group userś name in /etc/vsftpd.chroot_list
Then in the /etc/passwd
file make the home directory of all the users belonging to ftp-users group to /home/ftp-docs/ftp_stuff
. Then do the following:
service vsftpd restart
Then login via any user belonging to ftp-users group you will lend into /home/ftp-docs/ftp_stuff
. You cant go to the other higher level directories.
you can create multiple entries in the list for multiple groups. the order in which those groups are in the list file will dictate their highest directory I believe.
I'm not trying to jail my users to a specific directory. I'm trying to have all users go to the / directory upon authentication.
– Fre_d
Mar 2 '16 at 11:15
add a comment |
Just add this line to /etc/vsftpd.conf
:
local_root=/
Essentially, you can set it to whatever directory you want. You also can use $USER
in the path, it will be replaced with user's login.
So, if you set local_root
, for example, to /home/$USER/ftp
, then when a user connects to your server, he will be directed to the ftp
folder in his home directory.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f741164%2fhow-to-change-vsftpds-default-directory-to-instead-of-the-users-home-directo%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can create a chroot list with vsftpd.conf
Check this
All the users belonging to ftp-users group goes into /home/ftp-docs/ftp_stuff by default when they login. They cannot navigate in other directories and are restricted to this particular directory.
You do this:
Create a directory by issuing the following command as root:
mkdir -p /home/ftp-docs/ftp_stuff
Then do this:-
chgrp ftp-users /home/ftp-docs/ftp_stuff chmod 3777 /home/ftp-docs/ftp_stuff
In the /etc/vsftpd/vsftpd.conf
write this chroot_list_enable=YES chroot_list_file=/etc/vsftpd.chroot_list
Put all you ftp-users group userś name in /etc/vsftpd.chroot_list
Then in the /etc/passwd
file make the home directory of all the users belonging to ftp-users group to /home/ftp-docs/ftp_stuff
. Then do the following:
service vsftpd restart
Then login via any user belonging to ftp-users group you will lend into /home/ftp-docs/ftp_stuff
. You cant go to the other higher level directories.
you can create multiple entries in the list for multiple groups. the order in which those groups are in the list file will dictate their highest directory I believe.
I'm not trying to jail my users to a specific directory. I'm trying to have all users go to the / directory upon authentication.
– Fre_d
Mar 2 '16 at 11:15
add a comment |
You can create a chroot list with vsftpd.conf
Check this
All the users belonging to ftp-users group goes into /home/ftp-docs/ftp_stuff by default when they login. They cannot navigate in other directories and are restricted to this particular directory.
You do this:
Create a directory by issuing the following command as root:
mkdir -p /home/ftp-docs/ftp_stuff
Then do this:-
chgrp ftp-users /home/ftp-docs/ftp_stuff chmod 3777 /home/ftp-docs/ftp_stuff
In the /etc/vsftpd/vsftpd.conf
write this chroot_list_enable=YES chroot_list_file=/etc/vsftpd.chroot_list
Put all you ftp-users group userś name in /etc/vsftpd.chroot_list
Then in the /etc/passwd
file make the home directory of all the users belonging to ftp-users group to /home/ftp-docs/ftp_stuff
. Then do the following:
service vsftpd restart
Then login via any user belonging to ftp-users group you will lend into /home/ftp-docs/ftp_stuff
. You cant go to the other higher level directories.
you can create multiple entries in the list for multiple groups. the order in which those groups are in the list file will dictate their highest directory I believe.
I'm not trying to jail my users to a specific directory. I'm trying to have all users go to the / directory upon authentication.
– Fre_d
Mar 2 '16 at 11:15
add a comment |
You can create a chroot list with vsftpd.conf
Check this
All the users belonging to ftp-users group goes into /home/ftp-docs/ftp_stuff by default when they login. They cannot navigate in other directories and are restricted to this particular directory.
You do this:
Create a directory by issuing the following command as root:
mkdir -p /home/ftp-docs/ftp_stuff
Then do this:-
chgrp ftp-users /home/ftp-docs/ftp_stuff chmod 3777 /home/ftp-docs/ftp_stuff
In the /etc/vsftpd/vsftpd.conf
write this chroot_list_enable=YES chroot_list_file=/etc/vsftpd.chroot_list
Put all you ftp-users group userś name in /etc/vsftpd.chroot_list
Then in the /etc/passwd
file make the home directory of all the users belonging to ftp-users group to /home/ftp-docs/ftp_stuff
. Then do the following:
service vsftpd restart
Then login via any user belonging to ftp-users group you will lend into /home/ftp-docs/ftp_stuff
. You cant go to the other higher level directories.
you can create multiple entries in the list for multiple groups. the order in which those groups are in the list file will dictate their highest directory I believe.
You can create a chroot list with vsftpd.conf
Check this
All the users belonging to ftp-users group goes into /home/ftp-docs/ftp_stuff by default when they login. They cannot navigate in other directories and are restricted to this particular directory.
You do this:
Create a directory by issuing the following command as root:
mkdir -p /home/ftp-docs/ftp_stuff
Then do this:-
chgrp ftp-users /home/ftp-docs/ftp_stuff chmod 3777 /home/ftp-docs/ftp_stuff
In the /etc/vsftpd/vsftpd.conf
write this chroot_list_enable=YES chroot_list_file=/etc/vsftpd.chroot_list
Put all you ftp-users group userś name in /etc/vsftpd.chroot_list
Then in the /etc/passwd
file make the home directory of all the users belonging to ftp-users group to /home/ftp-docs/ftp_stuff
. Then do the following:
service vsftpd restart
Then login via any user belonging to ftp-users group you will lend into /home/ftp-docs/ftp_stuff
. You cant go to the other higher level directories.
you can create multiple entries in the list for multiple groups. the order in which those groups are in the list file will dictate their highest directory I believe.
answered Mar 2 '16 at 11:07
KPK
11
11
I'm not trying to jail my users to a specific directory. I'm trying to have all users go to the / directory upon authentication.
– Fre_d
Mar 2 '16 at 11:15
add a comment |
I'm not trying to jail my users to a specific directory. I'm trying to have all users go to the / directory upon authentication.
– Fre_d
Mar 2 '16 at 11:15
I'm not trying to jail my users to a specific directory. I'm trying to have all users go to the / directory upon authentication.
– Fre_d
Mar 2 '16 at 11:15
I'm not trying to jail my users to a specific directory. I'm trying to have all users go to the / directory upon authentication.
– Fre_d
Mar 2 '16 at 11:15
add a comment |
Just add this line to /etc/vsftpd.conf
:
local_root=/
Essentially, you can set it to whatever directory you want. You also can use $USER
in the path, it will be replaced with user's login.
So, if you set local_root
, for example, to /home/$USER/ftp
, then when a user connects to your server, he will be directed to the ftp
folder in his home directory.
add a comment |
Just add this line to /etc/vsftpd.conf
:
local_root=/
Essentially, you can set it to whatever directory you want. You also can use $USER
in the path, it will be replaced with user's login.
So, if you set local_root
, for example, to /home/$USER/ftp
, then when a user connects to your server, he will be directed to the ftp
folder in his home directory.
add a comment |
Just add this line to /etc/vsftpd.conf
:
local_root=/
Essentially, you can set it to whatever directory you want. You also can use $USER
in the path, it will be replaced with user's login.
So, if you set local_root
, for example, to /home/$USER/ftp
, then when a user connects to your server, he will be directed to the ftp
folder in his home directory.
Just add this line to /etc/vsftpd.conf
:
local_root=/
Essentially, you can set it to whatever directory you want. You also can use $USER
in the path, it will be replaced with user's login.
So, if you set local_root
, for example, to /home/$USER/ftp
, then when a user connects to your server, he will be directed to the ftp
folder in his home directory.
answered Feb 4 '18 at 13:17
Nullcaller
11
11
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f741164%2fhow-to-change-vsftpds-default-directory-to-instead-of-the-users-home-directo%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Maybe you won't have to do this. Check this link: vsftpd.beasts.org/vsftpd_conf.html especially your settings of
chroot
for users.– HATEthePLOT
Mar 2 '16 at 11:11
Related: change home directory only when connecting with FTP
– Eliah Kagan
Jul 30 '17 at 21:29