Fedora 26,27 – Enable sftp ONLY and TigerVNC server

Enable sftp ONLY

# useradd dave
# groupadd sftpusers
# usermod -G sftpusers dave
# vi /etc/ssh/sshd_config

– 140G – comment out and add a line below

#Subsystem sftp /usr/libexec/openssh/sftp-server
Subsystem sftp internal-sftp

– add to the end

Match Group sftpusers
  X11Forwarding no
  AllowTcpForwarding no
  ChrootDirectory /home
  ForceCommand internal-sftp

– :wq – save and quit

# systemctl enable sshd  

Enable TigerVNC

# dnf install tigervnc-server
# ln /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service 
# vi /etc/systemd/system/vncserver@:1.service

– replace USER with your user from these two lines. You can remove the geometry if you like too.

ExecStart=/sbin/runuser -l USER -c "/usr/bin/vncserver %i -geometry 1280x1024"
PIDFile=/home/USER/.vnc/%H%i.pid
# systemctl enable vncserver@:1.service
# su - USER
$ vncpasswd
Password:
Verify:
$ exit
# reboot
Tagged with: , , , ,

Leave a Reply