Could not chdir to home directory /home/Me: No such file or directoryIt is fair to jail my SFTP users to their home directory?xauth, ssh and missing home directorySSH certificate authentication for the user without home directoryCopSSH SFTP — limit users access to their home directory onlyCan I execute some commands when starting ssh session before getting to interactive mode?Empty homedir name when SSHing to localhosteCryptfs on ubuntu server : How to keep the home mounted without being over ssh?Add a Home directory for already created user when no direct root login availableUnable to create Home Directory for LDAP LoginAllow ssh when g+w on user's home directory
What's the logic behind the the organization of Hamburg's bus transport into "rings"?
How to pass a regex when finding a directory path in bash?
Company is asking me to work from overseas, but wants me to take a paycut
What are they doing to this poor rocket?
Diet Coke or water?
Is it a problem that pull requests are approved without any comments
Explain Ant-Man's "not it" scene from Avengers: Endgame
The ring of global sections of a regular scheme
Riley's, assemble!
How much water is needed to create a Katana capable of cutting flesh, bones and wood?
Comma Code - Ch. 4 Automate the Boring Stuff
X-shaped crossword
What are the words for people who cause trouble believing they know better?
Working in the USA for living expenses only; allowed on VWP?
Avoiding cliches when writing gods
California: "For quality assurance, this phone call is being recorded"
What is a simple, physical situation where complex numbers emerge naturally?
Does any lore text explain why the planes of Acheron, Gehenna, and Carceri are the alignment they are?
How bad would a partial hash leak be, realistically?
Movie where a boy is transported into the future by an alien spaceship
What happened to all the nuclear material being smuggled after the fall of the USSR?
Applicants clearly not having the skills they advertise
Is the decompression of compressed and encrypted data without decryption also theoretically impossible?
Opposite of "Squeaky wheel gets the grease"
Could not chdir to home directory /home/Me: No such file or directory
It is fair to jail my SFTP users to their home directory?xauth, ssh and missing home directorySSH certificate authentication for the user without home directoryCopSSH SFTP — limit users access to their home directory onlyCan I execute some commands when starting ssh session before getting to interactive mode?Empty homedir name when SSHing to localhosteCryptfs on ubuntu server : How to keep the home mounted without being over ssh?Add a Home directory for already created user when no direct root login availableUnable to create Home Directory for LDAP LoginAllow ssh when g+w on user's home directory
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
On a daily basis, I interact with 10s of productions servers which do not, and should not have a home directory for my personal user.
Every SSH session is met with the same error message:
Could not chdir to home directory /home/Me: No such file or directory
Killed by signal 1.
Is there a way to prevent SSH from trying to cd me into /home/Me, or is there any other way to surpress this message?
linux ssh home-directory
|
show 2 more comments
On a daily basis, I interact with 10s of productions servers which do not, and should not have a home directory for my personal user.
Every SSH session is met with the same error message:
Could not chdir to home directory /home/Me: No such file or directory
Killed by signal 1.
Is there a way to prevent SSH from trying to cd me into /home/Me, or is there any other way to surpress this message?
linux ssh home-directory
"which do not, and should not have a home directory for my personal user." that is a very strange setup indeed. How is thesshd
daemon expected to know in which directory you should land upon connecting? Have a look atChrootDirectory
but it needs various setup. Or something like that to adapt :ForceCommand bash -c "cd /tmp; bash --login"
(ugly, and not sure that works), otherwise you need to look at PAM and speciallypam_mkhomedir
that you will need to plug from sshd PAM config.
– Patrick Mevzek
Jun 29 '18 at 21:59
@PatrickMevzek These are production virtual machines, there are thousands of them, across tens of different fleets. Even if I automated the creation of a home directory for me on each of them, it would only be temporary, because VMs are shutdown and created as necessary to fit demand.
– Alexander
Jun 29 '18 at 22:36
@PatrickMevzek Ideally, I was hoping there might be some flag to tell SSH to spit me out at/
– Alexander
Jun 29 '18 at 22:36
This is the purpose ofpam_mkhomedir
it creates the home directory automatically upon login, if missing. And you can centralize authentication through some LDAP server so no need to have you as user in/etc/passwd
. Or it can be in the VM template. Otherwise you could always recompile your own ssh that does 'chdir /' but I am not sure it is a good idea, just try ForceCommand or even better proper user management with PAM, this will be simpler...
– Patrick Mevzek
Jun 29 '18 at 22:48
@PatrickMevzek I'll talk with the devops team, see what they think. I suspect they wouldn't be too fond of the idea of every ssh'ed user opening new dirs on prod servers
– Alexander
Jun 29 '18 at 22:55
|
show 2 more comments
On a daily basis, I interact with 10s of productions servers which do not, and should not have a home directory for my personal user.
Every SSH session is met with the same error message:
Could not chdir to home directory /home/Me: No such file or directory
Killed by signal 1.
Is there a way to prevent SSH from trying to cd me into /home/Me, or is there any other way to surpress this message?
linux ssh home-directory
On a daily basis, I interact with 10s of productions servers which do not, and should not have a home directory for my personal user.
Every SSH session is met with the same error message:
Could not chdir to home directory /home/Me: No such file or directory
Killed by signal 1.
Is there a way to prevent SSH from trying to cd me into /home/Me, or is there any other way to surpress this message?
linux ssh home-directory
linux ssh home-directory
asked Jun 29 '18 at 20:04
AlexanderAlexander
13116
13116
"which do not, and should not have a home directory for my personal user." that is a very strange setup indeed. How is thesshd
daemon expected to know in which directory you should land upon connecting? Have a look atChrootDirectory
but it needs various setup. Or something like that to adapt :ForceCommand bash -c "cd /tmp; bash --login"
(ugly, and not sure that works), otherwise you need to look at PAM and speciallypam_mkhomedir
that you will need to plug from sshd PAM config.
– Patrick Mevzek
Jun 29 '18 at 21:59
@PatrickMevzek These are production virtual machines, there are thousands of them, across tens of different fleets. Even if I automated the creation of a home directory for me on each of them, it would only be temporary, because VMs are shutdown and created as necessary to fit demand.
– Alexander
Jun 29 '18 at 22:36
@PatrickMevzek Ideally, I was hoping there might be some flag to tell SSH to spit me out at/
– Alexander
Jun 29 '18 at 22:36
This is the purpose ofpam_mkhomedir
it creates the home directory automatically upon login, if missing. And you can centralize authentication through some LDAP server so no need to have you as user in/etc/passwd
. Or it can be in the VM template. Otherwise you could always recompile your own ssh that does 'chdir /' but I am not sure it is a good idea, just try ForceCommand or even better proper user management with PAM, this will be simpler...
– Patrick Mevzek
Jun 29 '18 at 22:48
@PatrickMevzek I'll talk with the devops team, see what they think. I suspect they wouldn't be too fond of the idea of every ssh'ed user opening new dirs on prod servers
– Alexander
Jun 29 '18 at 22:55
|
show 2 more comments
"which do not, and should not have a home directory for my personal user." that is a very strange setup indeed. How is thesshd
daemon expected to know in which directory you should land upon connecting? Have a look atChrootDirectory
but it needs various setup. Or something like that to adapt :ForceCommand bash -c "cd /tmp; bash --login"
(ugly, and not sure that works), otherwise you need to look at PAM and speciallypam_mkhomedir
that you will need to plug from sshd PAM config.
– Patrick Mevzek
Jun 29 '18 at 21:59
@PatrickMevzek These are production virtual machines, there are thousands of them, across tens of different fleets. Even if I automated the creation of a home directory for me on each of them, it would only be temporary, because VMs are shutdown and created as necessary to fit demand.
– Alexander
Jun 29 '18 at 22:36
@PatrickMevzek Ideally, I was hoping there might be some flag to tell SSH to spit me out at/
– Alexander
Jun 29 '18 at 22:36
This is the purpose ofpam_mkhomedir
it creates the home directory automatically upon login, if missing. And you can centralize authentication through some LDAP server so no need to have you as user in/etc/passwd
. Or it can be in the VM template. Otherwise you could always recompile your own ssh that does 'chdir /' but I am not sure it is a good idea, just try ForceCommand or even better proper user management with PAM, this will be simpler...
– Patrick Mevzek
Jun 29 '18 at 22:48
@PatrickMevzek I'll talk with the devops team, see what they think. I suspect they wouldn't be too fond of the idea of every ssh'ed user opening new dirs on prod servers
– Alexander
Jun 29 '18 at 22:55
"which do not, and should not have a home directory for my personal user." that is a very strange setup indeed. How is the
sshd
daemon expected to know in which directory you should land upon connecting? Have a look at ChrootDirectory
but it needs various setup. Or something like that to adapt : ForceCommand bash -c "cd /tmp; bash --login"
(ugly, and not sure that works), otherwise you need to look at PAM and specially pam_mkhomedir
that you will need to plug from sshd PAM config.– Patrick Mevzek
Jun 29 '18 at 21:59
"which do not, and should not have a home directory for my personal user." that is a very strange setup indeed. How is the
sshd
daemon expected to know in which directory you should land upon connecting? Have a look at ChrootDirectory
but it needs various setup. Or something like that to adapt : ForceCommand bash -c "cd /tmp; bash --login"
(ugly, and not sure that works), otherwise you need to look at PAM and specially pam_mkhomedir
that you will need to plug from sshd PAM config.– Patrick Mevzek
Jun 29 '18 at 21:59
@PatrickMevzek These are production virtual machines, there are thousands of them, across tens of different fleets. Even if I automated the creation of a home directory for me on each of them, it would only be temporary, because VMs are shutdown and created as necessary to fit demand.
– Alexander
Jun 29 '18 at 22:36
@PatrickMevzek These are production virtual machines, there are thousands of them, across tens of different fleets. Even if I automated the creation of a home directory for me on each of them, it would only be temporary, because VMs are shutdown and created as necessary to fit demand.
– Alexander
Jun 29 '18 at 22:36
@PatrickMevzek Ideally, I was hoping there might be some flag to tell SSH to spit me out at
/
– Alexander
Jun 29 '18 at 22:36
@PatrickMevzek Ideally, I was hoping there might be some flag to tell SSH to spit me out at
/
– Alexander
Jun 29 '18 at 22:36
This is the purpose of
pam_mkhomedir
it creates the home directory automatically upon login, if missing. And you can centralize authentication through some LDAP server so no need to have you as user in /etc/passwd
. Or it can be in the VM template. Otherwise you could always recompile your own ssh that does 'chdir /' but I am not sure it is a good idea, just try ForceCommand or even better proper user management with PAM, this will be simpler...– Patrick Mevzek
Jun 29 '18 at 22:48
This is the purpose of
pam_mkhomedir
it creates the home directory automatically upon login, if missing. And you can centralize authentication through some LDAP server so no need to have you as user in /etc/passwd
. Or it can be in the VM template. Otherwise you could always recompile your own ssh that does 'chdir /' but I am not sure it is a good idea, just try ForceCommand or even better proper user management with PAM, this will be simpler...– Patrick Mevzek
Jun 29 '18 at 22:48
@PatrickMevzek I'll talk with the devops team, see what they think. I suspect they wouldn't be too fond of the idea of every ssh'ed user opening new dirs on prod servers
– Alexander
Jun 29 '18 at 22:55
@PatrickMevzek I'll talk with the devops team, see what they think. I suspect they wouldn't be too fond of the idea of every ssh'ed user opening new dirs on prod servers
– Alexander
Jun 29 '18 at 22:55
|
show 2 more comments
2 Answers
2
active
oldest
votes
Edit /etc/passwd
and replace the relevant home directory with /
.
I can't do this on the production servers. Even if I did, it would be one off, and every one of the hundreds of other servers wouldn't have it.
– Alexander
Jun 29 '18 at 20:11
pssh -l youruser -h listofserver.txt 'sudo usermod -d / youruser'
– Some Linux Nerd
Jun 29 '18 at 20:14
@SomeLinuxNerd This doesn't work my application :( I can't make a predefined list of servers, because the servers I need to SSH into are rather ad-hoc, and most of them are VMs with limited lifespan (e.g. peak scaling for a certain time of year). And when I said I was dealing with hundreds of servers, I really did mean hundreds.
– Alexander
May 13 at 18:10
add a comment |
You can provide an aaa value for the homedir and point it to /tmp or something from your radius or ldap account.
Could you elaborate on this? What's an "aaa value"?
– Alexander
Jun 29 '18 at 20:10
well you lack homedir on multiple server so i assume that you authenticate using an aaa (authentication, authorization, accounting) server like radius, tacacs+ or ldap/ad? you can most likely use the same mechanism for the attribute 'homedir'
– Jonas Bjork
Jun 29 '18 at 20:18
I don't actually now what authentication mechanism is being used. Is there a simple way to check?
– Alexander
Jun 29 '18 at 20:23
well if you have access you could browse through /etc/pam.d config files or perhaps ask your server env design guys
– Jonas Bjork
Jun 29 '18 at 20:32
and /etc/ssh/sshd_config should give you a clue as well
– Jonas Bjork
Jun 29 '18 at 20:33
|
show 2 more comments
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
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%2fserverfault.com%2fquestions%2f918899%2fcould-not-chdir-to-home-directory-home-me-no-such-file-or-directory%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
Edit /etc/passwd
and replace the relevant home directory with /
.
I can't do this on the production servers. Even if I did, it would be one off, and every one of the hundreds of other servers wouldn't have it.
– Alexander
Jun 29 '18 at 20:11
pssh -l youruser -h listofserver.txt 'sudo usermod -d / youruser'
– Some Linux Nerd
Jun 29 '18 at 20:14
@SomeLinuxNerd This doesn't work my application :( I can't make a predefined list of servers, because the servers I need to SSH into are rather ad-hoc, and most of them are VMs with limited lifespan (e.g. peak scaling for a certain time of year). And when I said I was dealing with hundreds of servers, I really did mean hundreds.
– Alexander
May 13 at 18:10
add a comment |
Edit /etc/passwd
and replace the relevant home directory with /
.
I can't do this on the production servers. Even if I did, it would be one off, and every one of the hundreds of other servers wouldn't have it.
– Alexander
Jun 29 '18 at 20:11
pssh -l youruser -h listofserver.txt 'sudo usermod -d / youruser'
– Some Linux Nerd
Jun 29 '18 at 20:14
@SomeLinuxNerd This doesn't work my application :( I can't make a predefined list of servers, because the servers I need to SSH into are rather ad-hoc, and most of them are VMs with limited lifespan (e.g. peak scaling for a certain time of year). And when I said I was dealing with hundreds of servers, I really did mean hundreds.
– Alexander
May 13 at 18:10
add a comment |
Edit /etc/passwd
and replace the relevant home directory with /
.
Edit /etc/passwd
and replace the relevant home directory with /
.
answered Jun 29 '18 at 20:05
portonporton
282112
282112
I can't do this on the production servers. Even if I did, it would be one off, and every one of the hundreds of other servers wouldn't have it.
– Alexander
Jun 29 '18 at 20:11
pssh -l youruser -h listofserver.txt 'sudo usermod -d / youruser'
– Some Linux Nerd
Jun 29 '18 at 20:14
@SomeLinuxNerd This doesn't work my application :( I can't make a predefined list of servers, because the servers I need to SSH into are rather ad-hoc, and most of them are VMs with limited lifespan (e.g. peak scaling for a certain time of year). And when I said I was dealing with hundreds of servers, I really did mean hundreds.
– Alexander
May 13 at 18:10
add a comment |
I can't do this on the production servers. Even if I did, it would be one off, and every one of the hundreds of other servers wouldn't have it.
– Alexander
Jun 29 '18 at 20:11
pssh -l youruser -h listofserver.txt 'sudo usermod -d / youruser'
– Some Linux Nerd
Jun 29 '18 at 20:14
@SomeLinuxNerd This doesn't work my application :( I can't make a predefined list of servers, because the servers I need to SSH into are rather ad-hoc, and most of them are VMs with limited lifespan (e.g. peak scaling for a certain time of year). And when I said I was dealing with hundreds of servers, I really did mean hundreds.
– Alexander
May 13 at 18:10
I can't do this on the production servers. Even if I did, it would be one off, and every one of the hundreds of other servers wouldn't have it.
– Alexander
Jun 29 '18 at 20:11
I can't do this on the production servers. Even if I did, it would be one off, and every one of the hundreds of other servers wouldn't have it.
– Alexander
Jun 29 '18 at 20:11
pssh -l youruser -h listofserver.txt 'sudo usermod -d / youruser'
– Some Linux Nerd
Jun 29 '18 at 20:14
pssh -l youruser -h listofserver.txt 'sudo usermod -d / youruser'
– Some Linux Nerd
Jun 29 '18 at 20:14
@SomeLinuxNerd This doesn't work my application :( I can't make a predefined list of servers, because the servers I need to SSH into are rather ad-hoc, and most of them are VMs with limited lifespan (e.g. peak scaling for a certain time of year). And when I said I was dealing with hundreds of servers, I really did mean hundreds.
– Alexander
May 13 at 18:10
@SomeLinuxNerd This doesn't work my application :( I can't make a predefined list of servers, because the servers I need to SSH into are rather ad-hoc, and most of them are VMs with limited lifespan (e.g. peak scaling for a certain time of year). And when I said I was dealing with hundreds of servers, I really did mean hundreds.
– Alexander
May 13 at 18:10
add a comment |
You can provide an aaa value for the homedir and point it to /tmp or something from your radius or ldap account.
Could you elaborate on this? What's an "aaa value"?
– Alexander
Jun 29 '18 at 20:10
well you lack homedir on multiple server so i assume that you authenticate using an aaa (authentication, authorization, accounting) server like radius, tacacs+ or ldap/ad? you can most likely use the same mechanism for the attribute 'homedir'
– Jonas Bjork
Jun 29 '18 at 20:18
I don't actually now what authentication mechanism is being used. Is there a simple way to check?
– Alexander
Jun 29 '18 at 20:23
well if you have access you could browse through /etc/pam.d config files or perhaps ask your server env design guys
– Jonas Bjork
Jun 29 '18 at 20:32
and /etc/ssh/sshd_config should give you a clue as well
– Jonas Bjork
Jun 29 '18 at 20:33
|
show 2 more comments
You can provide an aaa value for the homedir and point it to /tmp or something from your radius or ldap account.
Could you elaborate on this? What's an "aaa value"?
– Alexander
Jun 29 '18 at 20:10
well you lack homedir on multiple server so i assume that you authenticate using an aaa (authentication, authorization, accounting) server like radius, tacacs+ or ldap/ad? you can most likely use the same mechanism for the attribute 'homedir'
– Jonas Bjork
Jun 29 '18 at 20:18
I don't actually now what authentication mechanism is being used. Is there a simple way to check?
– Alexander
Jun 29 '18 at 20:23
well if you have access you could browse through /etc/pam.d config files or perhaps ask your server env design guys
– Jonas Bjork
Jun 29 '18 at 20:32
and /etc/ssh/sshd_config should give you a clue as well
– Jonas Bjork
Jun 29 '18 at 20:33
|
show 2 more comments
You can provide an aaa value for the homedir and point it to /tmp or something from your radius or ldap account.
You can provide an aaa value for the homedir and point it to /tmp or something from your radius or ldap account.
answered Jun 29 '18 at 20:07
Jonas BjorkJonas Bjork
1964
1964
Could you elaborate on this? What's an "aaa value"?
– Alexander
Jun 29 '18 at 20:10
well you lack homedir on multiple server so i assume that you authenticate using an aaa (authentication, authorization, accounting) server like radius, tacacs+ or ldap/ad? you can most likely use the same mechanism for the attribute 'homedir'
– Jonas Bjork
Jun 29 '18 at 20:18
I don't actually now what authentication mechanism is being used. Is there a simple way to check?
– Alexander
Jun 29 '18 at 20:23
well if you have access you could browse through /etc/pam.d config files or perhaps ask your server env design guys
– Jonas Bjork
Jun 29 '18 at 20:32
and /etc/ssh/sshd_config should give you a clue as well
– Jonas Bjork
Jun 29 '18 at 20:33
|
show 2 more comments
Could you elaborate on this? What's an "aaa value"?
– Alexander
Jun 29 '18 at 20:10
well you lack homedir on multiple server so i assume that you authenticate using an aaa (authentication, authorization, accounting) server like radius, tacacs+ or ldap/ad? you can most likely use the same mechanism for the attribute 'homedir'
– Jonas Bjork
Jun 29 '18 at 20:18
I don't actually now what authentication mechanism is being used. Is there a simple way to check?
– Alexander
Jun 29 '18 at 20:23
well if you have access you could browse through /etc/pam.d config files or perhaps ask your server env design guys
– Jonas Bjork
Jun 29 '18 at 20:32
and /etc/ssh/sshd_config should give you a clue as well
– Jonas Bjork
Jun 29 '18 at 20:33
Could you elaborate on this? What's an "aaa value"?
– Alexander
Jun 29 '18 at 20:10
Could you elaborate on this? What's an "aaa value"?
– Alexander
Jun 29 '18 at 20:10
well you lack homedir on multiple server so i assume that you authenticate using an aaa (authentication, authorization, accounting) server like radius, tacacs+ or ldap/ad? you can most likely use the same mechanism for the attribute 'homedir'
– Jonas Bjork
Jun 29 '18 at 20:18
well you lack homedir on multiple server so i assume that you authenticate using an aaa (authentication, authorization, accounting) server like radius, tacacs+ or ldap/ad? you can most likely use the same mechanism for the attribute 'homedir'
– Jonas Bjork
Jun 29 '18 at 20:18
I don't actually now what authentication mechanism is being used. Is there a simple way to check?
– Alexander
Jun 29 '18 at 20:23
I don't actually now what authentication mechanism is being used. Is there a simple way to check?
– Alexander
Jun 29 '18 at 20:23
well if you have access you could browse through /etc/pam.d config files or perhaps ask your server env design guys
– Jonas Bjork
Jun 29 '18 at 20:32
well if you have access you could browse through /etc/pam.d config files or perhaps ask your server env design guys
– Jonas Bjork
Jun 29 '18 at 20:32
and /etc/ssh/sshd_config should give you a clue as well
– Jonas Bjork
Jun 29 '18 at 20:33
and /etc/ssh/sshd_config should give you a clue as well
– Jonas Bjork
Jun 29 '18 at 20:33
|
show 2 more comments
Thanks for contributing an answer to Server Fault!
- 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%2fserverfault.com%2fquestions%2f918899%2fcould-not-chdir-to-home-directory-home-me-no-such-file-or-directory%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
"which do not, and should not have a home directory for my personal user." that is a very strange setup indeed. How is the
sshd
daemon expected to know in which directory you should land upon connecting? Have a look atChrootDirectory
but it needs various setup. Or something like that to adapt :ForceCommand bash -c "cd /tmp; bash --login"
(ugly, and not sure that works), otherwise you need to look at PAM and speciallypam_mkhomedir
that you will need to plug from sshd PAM config.– Patrick Mevzek
Jun 29 '18 at 21:59
@PatrickMevzek These are production virtual machines, there are thousands of them, across tens of different fleets. Even if I automated the creation of a home directory for me on each of them, it would only be temporary, because VMs are shutdown and created as necessary to fit demand.
– Alexander
Jun 29 '18 at 22:36
@PatrickMevzek Ideally, I was hoping there might be some flag to tell SSH to spit me out at
/
– Alexander
Jun 29 '18 at 22:36
This is the purpose of
pam_mkhomedir
it creates the home directory automatically upon login, if missing. And you can centralize authentication through some LDAP server so no need to have you as user in/etc/passwd
. Or it can be in the VM template. Otherwise you could always recompile your own ssh that does 'chdir /' but I am not sure it is a good idea, just try ForceCommand or even better proper user management with PAM, this will be simpler...– Patrick Mevzek
Jun 29 '18 at 22:48
@PatrickMevzek I'll talk with the devops team, see what they think. I suspect they wouldn't be too fond of the idea of every ssh'ed user opening new dirs on prod servers
– Alexander
Jun 29 '18 at 22:55