How to allow a remote user to connect over ssh on ubuntu 18.04Git and SFTP - How to separate them?I need a chroot user to now have ssh public key accessHow do I assign a specific user read/execute permissions to a susbset of folders in shell & SFTP?Allow user to connect to mysql via ssh to create database dump, but don't allow anything elseUser access restrictionsAllow a user to change his password on a chrooted environmentHow to create a user with a restricted shell

Check if simple regex matches string

Intuition behind image derivative using Fourier Transform for edges detection

Berlin 1923 & 1925 Address Book Abbreviations "I", "E", "Kgst" and "Mb"

Early computers without screens or sensors

make invisible depending on point of view

Is the net charge on a capacitor zero? If yes, then why?

What is the narrative difference between a Charisma and Wisdom saving throw?

How to I represent 5 eighth-notes as one note?

Simple solution for escaping from hanging Ubuntu OS (like pressing Ctrl+Alt+Del in Windows)?

Are there any spell casters that can cast life giving spells without 'expensive' components?

How to pair a xrightarrow with text on the top) to a sort of xleftarrow (with text on the bottom)?

Who started calling the matrix multiplication "multiplication"?

Putting creatures into play in alternative ways to summoning them

Why do aircraft cockpit displays use uppercase fonts?

Is it possible to kill parasitic worms by intoxicating oneself?

Is Kirk’s comment about “LDS” intended to be a religious joke?

Does the geothermal activity influence the climate in Iceland?

How to prevent discontent among the players when one player murders the others' characters?

Why are the Democrats & Republicans so homogeneous in their opinions of impeaching Trump?

What does "x employee is no longer employed by XYZ company" mean?

Why do LED Headlamp bulbs need active cooling?

Is a datagram from an upper network layer converted 1:1 to one of the lower layer?

How can I force a bank to close my account with them?

What's the current status of the Vehicle Routing Problem in the logistics industry?



How to allow a remote user to connect over ssh on ubuntu 18.04


Git and SFTP - How to separate them?I need a chroot user to now have ssh public key accessHow do I assign a specific user read/execute permissions to a susbset of folders in shell & SFTP?Allow user to connect to mysql via ssh to create database dump, but don't allow anything elseUser access restrictionsAllow a user to change his password on a chrooted environmentHow to create a user with a restricted shell






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









0


















Before you yell me out, I already checked the answers on the web but couldn't install the system that I want correctly. Here is what I want:



  • Allow a remote user to connect (to my pc) over ssh and able to use all the installed components like python, g++, opencv, etc.

  • Restrict the user in his own assigned subfolder like /home/remoteuser

  • I want the user to able to see correct prompt after login, like: user@host:$ (not -bash-4.4$)

  • I want the user to use all the bash commands since the solutions I have found so far don't allow the user to use even ls.

And I believe all the Linux users need all in one answer.



Last: I have Ubuntu 18.04.3 LTS



EDIT:



  • I have tried the way explained here: https://sxi.io/debian-ubuntu-linux-restrict-an-ssh-user-session-to-a-specific-directory-by-setting-chrooted-jail.html


  • Also, I have changed some options in sshd_config, like:


#ClientAliveInterval 0 to ClientAliveInterval 300



#PermitRootLogin prohibit-password to PermitRootLogin yes



#PubkeyAuthentication blabla to PubkeyAuthentication yes



#Subsystem sftp /usr/lib/openssh/sftp-server to Subsystem sftp internal-sftp



Added this block also:



##Apply the chrooted jail to the user called tom and jerry
Match User myremoteuser
ChrootDirectory /home/myremoteuser
## Allow sftp to chrooted jail ##
#ForceCommand internal-sftp
AllowUsers myremoteuser









share|improve this question



























  • Enable sshd & create a user with the restricted access you want. They need read access outside their own directory, otherwise they won't be able to run any commands (the need to see into the directory where commands are located, and then execute things there for commands to work). $PS1 is fully configurable. User to create is "remoteuser" in your example.

    – guiverc
    Oct 1 at 8:58











  • Please describe what you have tried and the outcome. For restricting the user, look at restricted shell, like rbash.

    – Soren A
    Oct 1 at 9:02











  • @SorenA actually I tried here: sxi.io/…

    – WhoCares
    Oct 1 at 9:03











  • @guiverc I tried here: sxi.io/… but I am open to any other easy way or a link that describes it.

    – WhoCares
    Oct 1 at 9:04











  • @WhoCares .. for chroot jails, you need to have all commands copied into the chroot environment, as is described in the page you refers to, little over halfway down with ls as an example. If you need all commands, the rbash I mentioned earlier might be an easier solution.

    – Soren A
    Oct 1 at 9:16

















0


















Before you yell me out, I already checked the answers on the web but couldn't install the system that I want correctly. Here is what I want:



  • Allow a remote user to connect (to my pc) over ssh and able to use all the installed components like python, g++, opencv, etc.

  • Restrict the user in his own assigned subfolder like /home/remoteuser

  • I want the user to able to see correct prompt after login, like: user@host:$ (not -bash-4.4$)

  • I want the user to use all the bash commands since the solutions I have found so far don't allow the user to use even ls.

And I believe all the Linux users need all in one answer.



Last: I have Ubuntu 18.04.3 LTS



EDIT:



  • I have tried the way explained here: https://sxi.io/debian-ubuntu-linux-restrict-an-ssh-user-session-to-a-specific-directory-by-setting-chrooted-jail.html


  • Also, I have changed some options in sshd_config, like:


#ClientAliveInterval 0 to ClientAliveInterval 300



#PermitRootLogin prohibit-password to PermitRootLogin yes



#PubkeyAuthentication blabla to PubkeyAuthentication yes



#Subsystem sftp /usr/lib/openssh/sftp-server to Subsystem sftp internal-sftp



Added this block also:



##Apply the chrooted jail to the user called tom and jerry
Match User myremoteuser
ChrootDirectory /home/myremoteuser
## Allow sftp to chrooted jail ##
#ForceCommand internal-sftp
AllowUsers myremoteuser









share|improve this question



























  • Enable sshd & create a user with the restricted access you want. They need read access outside their own directory, otherwise they won't be able to run any commands (the need to see into the directory where commands are located, and then execute things there for commands to work). $PS1 is fully configurable. User to create is "remoteuser" in your example.

    – guiverc
    Oct 1 at 8:58











  • Please describe what you have tried and the outcome. For restricting the user, look at restricted shell, like rbash.

    – Soren A
    Oct 1 at 9:02











  • @SorenA actually I tried here: sxi.io/…

    – WhoCares
    Oct 1 at 9:03











  • @guiverc I tried here: sxi.io/… but I am open to any other easy way or a link that describes it.

    – WhoCares
    Oct 1 at 9:04











  • @WhoCares .. for chroot jails, you need to have all commands copied into the chroot environment, as is described in the page you refers to, little over halfway down with ls as an example. If you need all commands, the rbash I mentioned earlier might be an easier solution.

    – Soren A
    Oct 1 at 9:16













0













0









0








Before you yell me out, I already checked the answers on the web but couldn't install the system that I want correctly. Here is what I want:



  • Allow a remote user to connect (to my pc) over ssh and able to use all the installed components like python, g++, opencv, etc.

  • Restrict the user in his own assigned subfolder like /home/remoteuser

  • I want the user to able to see correct prompt after login, like: user@host:$ (not -bash-4.4$)

  • I want the user to use all the bash commands since the solutions I have found so far don't allow the user to use even ls.

And I believe all the Linux users need all in one answer.



Last: I have Ubuntu 18.04.3 LTS



EDIT:



  • I have tried the way explained here: https://sxi.io/debian-ubuntu-linux-restrict-an-ssh-user-session-to-a-specific-directory-by-setting-chrooted-jail.html


  • Also, I have changed some options in sshd_config, like:


#ClientAliveInterval 0 to ClientAliveInterval 300



#PermitRootLogin prohibit-password to PermitRootLogin yes



#PubkeyAuthentication blabla to PubkeyAuthentication yes



#Subsystem sftp /usr/lib/openssh/sftp-server to Subsystem sftp internal-sftp



Added this block also:



##Apply the chrooted jail to the user called tom and jerry
Match User myremoteuser
ChrootDirectory /home/myremoteuser
## Allow sftp to chrooted jail ##
#ForceCommand internal-sftp
AllowUsers myremoteuser









share|improve this question
















Before you yell me out, I already checked the answers on the web but couldn't install the system that I want correctly. Here is what I want:



  • Allow a remote user to connect (to my pc) over ssh and able to use all the installed components like python, g++, opencv, etc.

  • Restrict the user in his own assigned subfolder like /home/remoteuser

  • I want the user to able to see correct prompt after login, like: user@host:$ (not -bash-4.4$)

  • I want the user to use all the bash commands since the solutions I have found so far don't allow the user to use even ls.

And I believe all the Linux users need all in one answer.



Last: I have Ubuntu 18.04.3 LTS



EDIT:



  • I have tried the way explained here: https://sxi.io/debian-ubuntu-linux-restrict-an-ssh-user-session-to-a-specific-directory-by-setting-chrooted-jail.html


  • Also, I have changed some options in sshd_config, like:


#ClientAliveInterval 0 to ClientAliveInterval 300



#PermitRootLogin prohibit-password to PermitRootLogin yes



#PubkeyAuthentication blabla to PubkeyAuthentication yes



#Subsystem sftp /usr/lib/openssh/sftp-server to Subsystem sftp internal-sftp



Added this block also:



##Apply the chrooted jail to the user called tom and jerry
Match User myremoteuser
ChrootDirectory /home/myremoteuser
## Allow sftp to chrooted jail ##
#ForceCommand internal-sftp
AllowUsers myremoteuser






18.04 ssh user-management sshd adduser






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 1 at 9:14







WhoCares

















asked Oct 1 at 8:52









WhoCaresWhoCares

473 bronze badges




473 bronze badges















  • Enable sshd & create a user with the restricted access you want. They need read access outside their own directory, otherwise they won't be able to run any commands (the need to see into the directory where commands are located, and then execute things there for commands to work). $PS1 is fully configurable. User to create is "remoteuser" in your example.

    – guiverc
    Oct 1 at 8:58











  • Please describe what you have tried and the outcome. For restricting the user, look at restricted shell, like rbash.

    – Soren A
    Oct 1 at 9:02











  • @SorenA actually I tried here: sxi.io/…

    – WhoCares
    Oct 1 at 9:03











  • @guiverc I tried here: sxi.io/… but I am open to any other easy way or a link that describes it.

    – WhoCares
    Oct 1 at 9:04











  • @WhoCares .. for chroot jails, you need to have all commands copied into the chroot environment, as is described in the page you refers to, little over halfway down with ls as an example. If you need all commands, the rbash I mentioned earlier might be an easier solution.

    – Soren A
    Oct 1 at 9:16

















  • Enable sshd & create a user with the restricted access you want. They need read access outside their own directory, otherwise they won't be able to run any commands (the need to see into the directory where commands are located, and then execute things there for commands to work). $PS1 is fully configurable. User to create is "remoteuser" in your example.

    – guiverc
    Oct 1 at 8:58











  • Please describe what you have tried and the outcome. For restricting the user, look at restricted shell, like rbash.

    – Soren A
    Oct 1 at 9:02











  • @SorenA actually I tried here: sxi.io/…

    – WhoCares
    Oct 1 at 9:03











  • @guiverc I tried here: sxi.io/… but I am open to any other easy way or a link that describes it.

    – WhoCares
    Oct 1 at 9:04











  • @WhoCares .. for chroot jails, you need to have all commands copied into the chroot environment, as is described in the page you refers to, little over halfway down with ls as an example. If you need all commands, the rbash I mentioned earlier might be an easier solution.

    – Soren A
    Oct 1 at 9:16
















Enable sshd & create a user with the restricted access you want. They need read access outside their own directory, otherwise they won't be able to run any commands (the need to see into the directory where commands are located, and then execute things there for commands to work). $PS1 is fully configurable. User to create is "remoteuser" in your example.

– guiverc
Oct 1 at 8:58





Enable sshd & create a user with the restricted access you want. They need read access outside their own directory, otherwise they won't be able to run any commands (the need to see into the directory where commands are located, and then execute things there for commands to work). $PS1 is fully configurable. User to create is "remoteuser" in your example.

– guiverc
Oct 1 at 8:58













Please describe what you have tried and the outcome. For restricting the user, look at restricted shell, like rbash.

– Soren A
Oct 1 at 9:02





Please describe what you have tried and the outcome. For restricting the user, look at restricted shell, like rbash.

– Soren A
Oct 1 at 9:02













@SorenA actually I tried here: sxi.io/…

– WhoCares
Oct 1 at 9:03





@SorenA actually I tried here: sxi.io/…

– WhoCares
Oct 1 at 9:03













@guiverc I tried here: sxi.io/… but I am open to any other easy way or a link that describes it.

– WhoCares
Oct 1 at 9:04





@guiverc I tried here: sxi.io/… but I am open to any other easy way or a link that describes it.

– WhoCares
Oct 1 at 9:04













@WhoCares .. for chroot jails, you need to have all commands copied into the chroot environment, as is described in the page you refers to, little over halfway down with ls as an example. If you need all commands, the rbash I mentioned earlier might be an easier solution.

– Soren A
Oct 1 at 9:16





@WhoCares .. for chroot jails, you need to have all commands copied into the chroot environment, as is described in the page you refers to, little over halfway down with ls as an example. If you need all commands, the rbash I mentioned earlier might be an easier solution.

– Soren A
Oct 1 at 9:16










0






active

oldest

votes













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/4.0/"u003ecc by-sa 4.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
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1177854%2fhow-to-allow-a-remote-user-to-connect-over-ssh-on-ubuntu-18-04%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown


























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded















































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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1177854%2fhow-to-allow-a-remote-user-to-connect-over-ssh-on-ubuntu-18-04%23new-answer', 'question_page');

);

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









Popular posts from this blog

Tamil (spriik) Luke uk diar | Nawigatjuun

Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

Training a classifier when some of the features are unknownWhy does Gradient Boosting regression predict negative values when there are no negative y-values in my training set?How to improve an existing (trained) classifier?What is effect when I set up some self defined predisctor variables?Why Matlab neural network classification returns decimal values on prediction dataset?Fitting and transforming text data in training, testing, and validation setsHow to quantify the performance of the classifier (multi-class SVM) using the test data?How do I control for some patients providing multiple samples in my training data?Training and Test setTraining a convolutional neural network for image denoising in MatlabShouldn't an autoencoder with #(neurons in hidden layer) = #(neurons in input layer) be “perfect”?