I have been trying to set up a SFTP server with multiple users chrooting into their home directories. I followed the advice on  () and then executed the following commands on the user's directories  chown root:root /home/user/ chmod 755 /home/user/   There is an additional folder in every user's home directory called public, which is owned by its user so as to allow them to create directories and upload and remove files as needed. (This was advised in the guide I mentioned earlier)  Now when I execute sftp -P 435 user@localhost, I get this error:     Write failed: Broken pipe   Couldn't read packet: Connection reset by peer   How do I proceed from here? The ultimate idea is to have each user on some other machine use FileZilla to log into their chrooted home directories and then be able to upload directories and files. All this in SFTP (because it's more secure)
I want to give a client access to my server, but I want to limit those users to their home directories. I will bind-mount in any files I want them to be able to see.  I've created a user called bob and added him to a new group called sftponly. They have a home directory at /home/bob. I've changed their shell to /bin/false to stop SSH logins. Here is their /etc/passwd line:  bob:x:1001:1002::/home/bob:/bin/false   I've also changed the /etc/ssh/sshd_config to include the following:  Match Group sftponly         ChrootDirectory /home/%u         ForceCommand internal-sftp         AllowTcpForwarding no   When I try to log in as them, here's what I see   $ sftp bob@server bob@server's password:  Write failed: Broken pipe Couldn't read packet: Connection reset by peer   If I comment out the ChrootDirectory line I can SFTP in but then they have free rein over the server. I have found that ChrootDirectory /home works, but it still gives them access to any home directory. I have explicitly tried ChrootDirectory /home/bob but that doesn't work either.  What am I doing wrong? How can I limit bob to /home/bob/?  ----EDIT-----  Okay so I just had a look at /var/log/auth.log and saw this:  May  9 14:45:48 nj sshd[5074]: pam_unix(sshd:session): session opened for user bob by (uid=0) May  9 14:45:48 nj sshd[5091]: fatal: bad ownership or modes for chroot directory component "/home/bob/" May  9 14:45:48 nj sshd[5074]: pam_unix(sshd:session): session closed for user bob   I'm not entirely sure what's going on there,  but it suggests something is wrong with the user directory. Here is the ls -h /home output:  drwxr-xr-x 26 oli      oli      4096 2012-01-19 17:19 oli drwxr-xr-x  3 bob      bob      4096 2012-05-09 14:11 bob
Proof that no term (of a language of predicate logic) is a (non-empty) initial segment of another How can the Anomalous Expansion of Water from 4$^\circ$C to 0$^\circ$C be explained with reference to subatomic particles? How to check if sed has changed a file What it's the best way to generate a string of \t's in C#  I am learning C# and experimenting with different ways of saying the same thing.    Tabs(uint t) is a function that returns a string with t amount of \t's  For example Tabs(3) returns "\t\t\t"  Which of these three ways of implementing Tabs(uint numTabs) is best?  Of course that depends on what "best" means.     The LINQ version is only two lines, which is nice.  But are the calls to Repeat and Aggregate unnecessarily time/resource consuming? The StringBuilder version is very clear but is the StringBuilder class somehow slower? The string version is basic, which means it is easy to understand.   Does it not matter at all?  Are they all equal?   These are all questions to help me get a better feel for C#.     private string Tabs(uint numTabs) {     IEnumerable&lt;string&gt; tabs = Enumerable.Repeat("\t", (int) numTabs);     return (numTabs &gt; 0) ? tabs.Aggregate((sum, next) =&gt; sum + next) : "";  }    private string Tabs(uint numTabs) {     StringBuilder sb = new StringBuilder();     for (uint i = 0; i &lt; numTabs; i++)         sb.Append("\t");      return sb.ToString(); }    private string Tabs(uint numTabs) {     string output = "";     for (uint i = 0; i &lt; numTabs; i++)     {         output += '\t';     }     return output;  } db_update Query Issue I am using ubercart guest checkout module. I am able to submit  the order as guest etc works fine.   After Reviewing the order and submitting it throws me this error   Recoverable fatal error: Argument 2 passed to db_query() must be an array, string given, called in /var/www/html/dev.demo.net/sites/all/modules/ubercart_guest_checkout/uc_guest_checkout.module on line 263 and defined in db_query() (line 2342 of /var/www/html/dev.demo.net/includes/database/database.inc).   This is the query which is causing that issue    db_query('UPDATE {users} SET name = "%s", mail = "%s" WHERE uid = %d', $name, $mail, $account-&gt;uid);   I tried to change this query like this  db_update('users') -&gt;fields(array(     'name' =&gt; $name,     'mail' =&gt; $mail )) -&gt;condition('uid',$account-&gt;uid,'=')        -&gt;execute();   still no luck, it throws me same above specified error.    How can i resolve the query of above one in order to avoid the error. Any suggestions w.r.t query will be nice.Thanks in advance. Quite often, the phrase "x for x's sake" is used in English, and so one could describe someone as being "argumentative for argument's sake" to describe someone who is arguing for the sake of arguing.  However, is there an adjective that means the same thing?  For example, it could be used in the context:     I don't want to be [X], but [argument...]   ... indicating that your argument is necessary and not intended to irritate. Does python optimize modules when they are imported multiple times? If a large module is loaded by some submodule of your code, is there any benefit to referencing the module from that namespace instead of importing it again?  For example: I have a module MyLib, which makes extensive use of ReallyBigLib. If I have code that imports MyLib, should I dig the module out like so  import MyLib ReallyBigLib = MyLib.SomeModule.ReallyBigLib   or just  import MyLib import ReallyBigLib Clarify or visualize the parameters involved for receiving the Curious badge When is an elected moderator shown as "departed" on the election page? On Philosophy, one of the elected moderators has since deleted their account, and they're shown as "Departed" on :        However, , one of the elected moderators still has their "previous" flair shown in place, despite the fact that they've already resigned and left the Network completely in the wake of the recent events.        , the same happens (old flair remains), but without the clickable &lt;a&gt; around the image, and with a noticeable :        This looks inconsistent, so when exactly will a placeholder image showing "Departed" replace the flair for a departed election winner? I have set of temp files created in my folder with .bak extensions. How can I make them hide by default in Ubuntu?  I tried adding a .hidden file with *.bak as entry in the file, but that is not working. Any help is very appreciated... How do I fix 'Invalid JSON' errors? I've been at this for almost two hours and no one seems to have the same problem as I and I doubt this will be solved but I'll try anyway.  this is the code  /tellraw @p ["Would you like to teleport?",{"text":"Yes","color":"green","bold":"true","clickEvent":{"action":"run_command","value":"/tp @p ~ ~4 ~ "},"hoverEvent":{"action":"show_text","value":{"text":"Confirm"}},{"text":"No","color":"red","bold":"true","clickEvent":{"action":"run_command","value":"/tellraw @p{"text":"Come back when you want to teleport"}"}}}]   this part is fine  /tellraw @p ["Would you like to teleport?",{"text":"Yes","color":"green","bold":"true","clickEvent":{"action":"run_command","value":"/tp @p ~ ~4 ~ "},"hoverEvent":{"action":"show_text","value":{"text":"Confirm"}}   it's just when I add this  ,{"text":"No","color":"red","bold":"true","clickEvent":{"action":"run_command","value":"/tellraw @p{"text":"Come back when you want to teleport"}"}}}]   Minecraft gives me the error:     Invalid JSON at line 1 column 203   I've tried to space it out and figure out what column 203 is but I can't, I don't know what I did. Anyone got any ideas? What are examples of two non-similar invertible matrices with same minimal and characteristic polynomial and same dimension of each eigenspace? I have 3 old 3.5" internal hard drives sitting gathering dust at the moment. 2 are SATA, and one IDE. I want to either start putting them to use, or dispose of them to clear up some space.  What is the best approach towards disposing of the drives in terms of thoroughly cleaning the contents before throwing away or selling? Are there any recommendations for good software to use to do this?   Are there any 100% successful methods which result in having a usable drive at the end? Find n such that $n^5 - n$ is divisible by $120$. (*Here $n$ belongs to the natural number set)  Seems a trivial problem, but the answer mentioned in the text book seemed incomplete to me so I'm here just to ensure whether approach to this problem is correct or not.  So my approach is as follows: We know that $n^5 - n$ can be written as $n^5-n = n(n-1)(n+1)(n^2 + 1)$  Now since it's product of three consecutive natural numbers so it's divisible by $3! = 6$. Now using Fermat's Little theorem we can prove that $n^5= n \mod5$ hence $n^5 - n$ is divisible by $5$ as well. So $n^5 - n$ is divisible by $30$. Now to ensure their is another factor of $4$ in the term we need to ensure that $n^5 - n$ is divisible by $8$. I found that all odd natural numbers and multiples of $8$ makes $n^5 - n$ divisible by $8$, hence $n^5 - n$ is divisible by $120$. But in the text book they have only mentioned odd natural numbers as answer, which seemed incomplete to me.  Thanking everyone in advance:P ODBC and ADO connection to SQL Server: What protocol is used when connecting to \? Ubuntu 12.10 "Turn screen off when inactive for: Never" still turns off macOS app for showing external HDD usage statistics? I'm planning on selling a used external HDD on eBay.  Are there any applications for Mac out there (preferably free) that can show me statistics about the usage history for the drive so that I can let potential buyers know the condition more precisely? What is the setting in bash for globbing, to control whether * matches dot files I was surprised recently when I did something like mv ./* ../somedirectory and found that files like .gitignore were not moved.  I do most of my work in zsh on OS X, and this surprise bit me in bash on CentOS.  I tried bash on OS X and found the same behavior: * does not match dot files.  This seems very undesirable to me, but apparently it's the bash default.  (It may be the zsh default too for all I remember, but I may have changed it years ago in my .zshrc and forgotten it ever worked differently.)  How can I configure bash to behave as I expected: for * to match all files, and not ignore dot files.  In case this is at all unclear, here's how to reproduce it    cd /tmp mkdir {t,d}est touch test/{.,}{1,2,3,4,5,6,7} ls -hal test mv test/* dest ls -hal test     # notice dot files are still there ls -hal dest     # notice only some files were mv'ed What order do triggered abilities happen in if multiple things trigger at the same time? I had several humans on the battlefield.  On turn three, I played . On turn four, I played . On turn five, during my upkeep, this question came up.  At this point, I need to draw/reveal three cards. If I reveal a human, Descendants' Path will allow me to cast it without paying its mana cost.  So, does it matter when I draw the human?  The static abilities state "at the beginning up your upkeep..." which leads me to believe that those two draws/reveals would happen before my normal draw. If that's the case, does the draw order happen in the same order that I played the enchantments?  In the end, that's how we decided to do it. I drew first for Triumph of Ferocity, then I revealed for Descendants' Path, then I drew for my turn. Did we do it right? Low Quality review queue erroneously showing "Close" instead of "Recommended Close"? I was in the Low Quality Review queue, and the following review confused me:    It's showing eight "Close votes", which should be more than enough to close a question.  I checked the question's , and it wasn't somehow closed, then re-opened in the middle of the review.  So I then checked on each of the users, and noticed that the majority of them are under 3000 reputation, meaning they can only "Recommend Close".    However, all reviews are simply showing as "Close", which is extremely confusing.  Is this a bug, or possibly an undocumented change related to ?    Another recent example: