Permissions+default directory in openssh on ubuntu
Posted on 2013-01-27
I have a pretty basic ubuntu system running in a vm to do open-ssh. By default each user that gets in via sftp goes to /home/username. I need to change a user to go to a different directory when logging in. Note that this user has no password, just a private key (so its authenticating with username+private key). I need the user bob to default to the /home/homer directory. I change this by nano /etc/passwd and changing the default but then when user chuck tries to login it doesnt work - says server refused our connection, change it back to /home/bob and it works fine. Bob does have all access to /home/homeward...he can write files to that directory, change to that directory, and delete files from the directory so not sure why he cant go to that directory by default.
Using winscp to connect (windows machine) and you can specify the local and remote directories - doing this WILL work and allow him to "default" into the /home/homer directory, but I think winscp just logs in then changes directories for him right away (instead of the actual server putting him in that folder which is what I need).
I tried doing it via a group too - still no luck