{"id":564,"date":"2015-10-19T20:47:49","date_gmt":"2015-10-20T01:47:49","guid":{"rendered":"http:\/\/sunapi386.ca\/wordpress\/?p=564"},"modified":"2015-10-28T01:06:40","modified_gmt":"2015-10-28T06:06:40","slug":"guacamole-add-user","status":"publish","type":"post","link":"https:\/\/sunapi386.ca\/wordpress\/guacamole-add-user\/","title":{"rendered":"Guacamole Add User"},"content":{"rendered":"<h2>Adding a user<\/h2>\n<h3>https:\/\/gist.github.com\/sunapi386\/9dc6eb841f1454733e02<\/h3>\n<h3><a id=\"user-content-create-a-user\" class=\"anchor\" href=\"https:\/\/gist.github.com\/sunapi386\/9dc6eb841f1454733e02#create-a-user\"><\/a>Create a user<\/h3>\n<p>Then create the user; remember setting to his password to &#8220;chessman123&#8221;<\/p>\n<pre><code>sudo adduser binsun\r\n<\/code><\/pre>\n<h3><a id=\"user-content-modifying-guacamoles-user-login-data\" class=\"anchor\" href=\"https:\/\/gist.github.com\/sunapi386\/9dc6eb841f1454733e02#modifying-guacamoles-user-login-data\"><\/a>Modifying guacamole&#8217;s user login data<\/h3>\n<p>Edit the user mapping, unless you&#8217;re using a database to store user logins.<\/p>\n<pre><code>sudo vi \/etc\/guacamole\/user-mapping.xml\r\n<\/code><\/pre>\n<p>Create the entry like below, one for vnc and one for ssh.<\/p>\n<pre><code>&lt;!-- User for binsun --&gt;\r\n&lt;authorize username=\"binsun\" password=\"chessman123\"&gt;\r\n    &lt;!-- First authorized connection --&gt;\r\n    &lt;connection name=\"vnc\"&gt;\r\n        &lt;protocol&gt;vnc&lt;\/protocol&gt;\r\n        &lt;param name=\"hostname\"&gt;localhost&lt;\/param&gt;\r\n        &lt;param name=\"port\"&gt;5904&lt;\/param&gt;     &lt;!-- Edit this --&gt;\r\n        &lt;param name=\"password\"&gt;qwe123&lt;\/param&gt; &lt;!-- Password for vncserver --&gt;\r\n        &lt;param name=\"encodings\"&gt;zrle ultra copyrect hextile zlib corre rre raw&lt;\/param&gt;\r\n    &lt;\/connection&gt;\r\n    &lt;!-- Second authorized connection --&gt;\r\n    &lt;connection name=\"ssh\"&gt;\r\n        &lt;protocol&gt;ssh&lt;\/protocol&gt;\r\n        &lt;param name=\"hostname\"&gt;localhost&lt;\/param&gt;\r\n        &lt;param name=\"port\"&gt;22&lt;\/param&gt;\r\n        &lt;param name=\"username\"&gt;binsun&lt;\/param&gt; &lt;!-- Edit this --&gt;\r\n        &lt;param name=\"password\"&gt;chessman123&lt;\/param&gt; &lt;!-- Edit this --&gt;\r\n    &lt;\/connection&gt;\r\n&lt;\/authorize&gt;\r\n<\/code><\/pre>\n<h3><a id=\"user-content-ssh-service\" class=\"anchor\" href=\"https:\/\/gist.github.com\/sunapi386\/9dc6eb841f1454733e02#ssh-service\"><\/a>SSH Service<\/h3>\n<p>I assume the SSH service is already running on port 22, so that should already work.<\/p>\n<h3><a id=\"user-content-relaunching-service\" class=\"anchor\" href=\"https:\/\/gist.github.com\/sunapi386\/9dc6eb841f1454733e02#relaunching-service\"><\/a>Relaunching service<\/h3>\n<p>We just need to start the VNC service listening in on port 5903.<\/p>\n<pre><code>sudo \/etc\/init.d\/tomcat7 restart\r\n<\/code><\/pre>\n<p>Restart hosting service so it loads the updated user-mapping.xml.<\/p>\n<h3><a id=\"user-content-logging\" class=\"anchor\" href=\"https:\/\/gist.github.com\/sunapi386\/9dc6eb841f1454733e02#logging\"><\/a>Logging<\/h3>\n<p>If logging in fails, check the log for login attempts.<\/p>\n<pre><code>tail -f \/var\/log\/tomcat7\/catalina.out\r\n<\/code><\/pre>\n<h3><a id=\"user-content-setting-up-vnc\" class=\"anchor\" href=\"https:\/\/gist.github.com\/sunapi386\/9dc6eb841f1454733e02#setting-up-vnc\"><\/a>Setting up VNC<\/h3>\n<p>In the newly created user&#8217;s home directory, create a file called xstartup. This file is a script that gets run when the vncserver starts. Guacamole starts the vncservice.<\/p>\n<p>First we switch to that user.<\/p>\n<pre><code>su binsun\r\n<\/code><\/pre>\n<p>Then create the startup script<\/p>\n<pre><code>mkdir ~\/.vnc\r\nchmod 700 ~\/.vnc\r\ncd ~\/.vnc\r\nvi xstartup\r\n<\/code><\/pre>\n<p>Put these in.<\/p>\n<pre><code>#!\/bin\/sh\r\nxrdb $HOME\/.Xresources\r\nxsetroot -solid grey\r\n#x-terminal-emulator -geometry 80x24+10+10 -ls -title \"$VNCDESKTOP Desktop\" &amp;\r\n#x-window-manager &amp;\r\n# Fix to make GNOME work\r\nexport XKL_XMODMAP_DISABLE=1\r\n#\/etc\/X11\/Xsession\r\nstartxfce4\r\n<\/code><\/pre>\n<p>And make this excutable.<\/p>\n<pre><code>chmod +x xstartup\r\n<\/code><\/pre>\n<p>While we&#8217;re still logged in as the user, start the vncserver<\/p>\n<pre><code>vncserver :4\r\n<\/code><\/pre>\n<p>This creates the service listening on 5904 port. You should be able to see it.<\/p>\n<pre><code>nmap -Pn localhost\r\n\r\nStarting Nmap 6.40 ( http:\/\/nmap.org ) at 2015-10-19 21:40 EDT\r\nNmap scan report for localhost (127.0.0.1)\r\nHost is up (0.00055s latency).\r\nNot shown: 988 closed ports\r\nPORT     STATE SERVICE\r\n22\/tcp   open  ssh\r\n25\/tcp   open  smtp\r\n631\/tcp  open  ipp\r\n3306\/tcp open  mysql\r\n5902\/tcp open  vnc-2\r\n5903\/tcp open  vnc-3\r\n5904\/tcp open  unknown &lt;------- this is it\r\n6002\/tcp open  X11:2\r\n6003\/tcp open  X11:3\r\n6004\/tcp open  X11:4\r\n6005\/tcp open  X11:5\r\n8080\/tcp open  http-proxy\r\n<\/code><\/pre>\n<p>If you can&#8217;t get vnc started, look at this log.<\/p>\n<pre><code>tail -f \/var\/log\/syslog<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Adding a user https:\/\/gist.github.com\/sunapi386\/9dc6eb841f1454733e02 Create a user Then create the user; remember setting to his password to &#8220;chessman123&#8221; sudo adduser binsun Modifying guacamole&#8217;s user login data Edit the user mapping, unless you&#8217;re using a database to store user logins. sudo vi \/etc\/guacamole\/user-mapping.xml Create the entry like below, one for vnc and one for ssh. &lt;!&#8211; &hellip; <a href=\"https:\/\/sunapi386.ca\/wordpress\/guacamole-add-user\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Guacamole Add User<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[],"class_list":["post-564","post","type-post","status-publish","format-standard","hentry","category-tutorial"],"_links":{"self":[{"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/posts\/564","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/comments?post=564"}],"version-history":[{"count":1,"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/posts\/564\/revisions"}],"predecessor-version":[{"id":565,"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/posts\/564\/revisions\/565"}],"wp:attachment":[{"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/media?parent=564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/categories?post=564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/tags?post=564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}