Change sFTP home directory for particular user and from specific server

Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Change sFTP home directory for particular user and from specific server
# 1  
Old 06-09-2017
Change sFTP home directory for particular user and from specific server

Hello Folks,

Of course i came here for your favour Smilie

How to set a defalult home directory for sFTP login ( at present users land in to their home directrory) when they connect from specific server.

When server(A) sFTP's to Linux server(B) they land to thier home directory.

I want the default directory to be /application/filessytem/data/.

Note: The users are authenticated from LDAP.

Thanks in Advance!
# 2  
Old 06-09-2017
The users will have to all use one sFTP account only on server B. That account will only be used for sFTP, and owns the .../.../data directory. If server B is a production server you need to be careful about restricting the new account to that one directory. Consider chrooting that account.

example chroot setup for linux: Creating a Chroot Jail for SSH Access | Allan Feid
# 3  
Old 06-09-2017
Not applicable for LDAP users?

Hi Jim,
THanks for your reply.

I tried the steps as suggested in that site. it still point me to ldap home directory.

I want the users to land in to /application/filessytem/data/ rather than /home/username

Also i dont want to change the home directory for the user in LDAP, because it affects his job in other servers.

# 4  
Old 06-09-2017
Originally Posted by Thala
I want the users to land in to /application/filessytem/data/ rather than /home/username
...which is why the first thing he mentioned was a new account which everyone shares, not the same account.

sftp logs in to a users' login directory, that's what its for.
# 5  
Old 06-09-2017
Hammer & Screwdriver

Hi Corona,
Do you mean i need users to tell to use sftp_test account? sorry i dont know how the sFTP authenticates.
But i created new local user and group.

Please remember from client, users enter their ldap credentials and that land in to the location of huge date of users profiles /ldap/home/ which cause too much delay in login.
And thats the reason i want to jailroot to application directory(less files)

So i need solution wither of this two options,
1.sFTP- chroot to /application/filessytem/data/
2.Change home path for end_user1 to /application/filessytem/data/ with specific hostname.
# 6  
Old 06-09-2017
IF a new employee comes in, how do you add that employee to server B? The same method is what you use for the sftp_account user. You specify a home directory when you create a new user. On linux the passwd/usermod command when run by the root or a suitable account with full passwd access, can be used to change the users home directory.

It may be be that
[ sudo ] usermod -d

is what you want to use. If you already have sftp_account as active.

I don't think your linux is so old it uses passwd for this

What precisely is server B? Please post the output of uname -a
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

SunOS confusing root directory and user home directory

Hello, I've just started using a Solaris machine with SunOS 5.10. After the machine is turned on, I open a Console window and at the prompt, if I execute a pwd command, it tells me I'm at my home directory (someone configured "myuser" as default user after init). ... (2 Replies)
Discussion started by: egyassun
2 Replies

2. HP-UX

[Solved] Unable to change/create home dir for particular user

Hi all I wanted to change the home dir for a user, but when using smh : SMH->Accounts for Users and Groups->Local Users->Modify User ---------------------------------------------------------------------------------------------------------------------------------------------- * Required... (8 Replies)
Discussion started by: fretagi
8 Replies

3. Solaris

how to change /export/home/user dir to /home /user in solaris

Hi all i am using solaris 10, i am creating user with useradd -d/home/user -m -s /bin/sh user user is created with in the following path /export/home/user (auto mount) i need the user to be created like this (/home as default home directory ) useradd -d /home/user -m -s /bin/sh... (2 Replies)
Discussion started by: kalyankalyan
2 Replies

4. Linux

SFTP user access restriction to his home dir

Hi Friends, I have installed a FTP Server on my Linux machine (Fedora 11). I want the ftp users to be restricted to their own home dir using sftp. But the said condition is met when the user logs in using ftp over port 21 and when the user logs in using sftp i.e. protocol 22, he/she has... (4 Replies)
Discussion started by: pashy
4 Replies

5. Red Hat

User's home directory

Hi, By default user's home directory will be /home/$user. I want to change it to /javauser/$user. How can I do it? Thanks Jeevan. (5 Replies)
Discussion started by: jredx
5 Replies

6. Solaris

Restricting SFTP user to a defined directory and home directory

Hi, I've created solaris user which has both FTP and SFTP Access. Using the "ftpaccess" configuration file options "guest-root" and "restricted-uid", i can restrict the user to a specific directory. But I'm unable to restrict the user when the user is logged in using SFTP. The aim is to... (1 Reply)
Discussion started by: sftpuser
1 Replies

7. Shell Programming and Scripting

change home directory by modifying passwd

hi How can I change the home directory of a user without using usermod -d command? ( by modifying /etc/passwd) (17 Replies)
Discussion started by: tjay83
17 Replies

8. Shell Programming and Scripting

Batch delete specific folder from user home directories

Hi! Need your help. How can I delete the cache folder of multiple user home directories via automatically executed shell script on a Mac OS X Server? Example: The userdata are stored on a Xsan Volume like this: /Volumes/Xsan/userdata/mike /Volumes/Xsan/userdata/peter... (2 Replies)
Discussion started by: nipodrom
2 Replies

9. UNIX Desktop Questions & Answers

How to set up a home SFTP server?

I want to setup a home SFTP server in order to transfer my files securely. But I don't know about this anything. My friends told that there are many secure file transfer tool are present in the net. I am unable to find the best one. Please share your experiences with and also give your suggestions... (1 Reply)
Discussion started by: verrock_poo
1 Replies
Login or Register to Ask a Question

Featured Tech Videos